Cannot save a view where a filter value option contains a period

Created on 8 August 2016, over 8 years ago
Updated 28 July 2024, 4 months ago

(I did not find this issue reported yet when searching. I apologize if this is a double report.)

I have created a module that defines a custom content entity type. The module code only defines a Title field and hidden fields.

Via the Drupal interface, I added a field named "Category" to this entity type. The Category field is a text list field that only accepts 1 choice ("select" widget).

In /admin/structure/views/, I attempt to create a new Page view to only retrieve instances of this entity that have a certain Category value.

Because one of the Category choices selected for this view contains a period ".", Drupal crashes and displays the following in an otherwise blank page:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Config\ConfigValueException: Dr. BPP key contains a dot which is not supported. in Drupal\Core\Config\ConfigBase->validateKeys() (line 211 of core\lib\Drupal\Core\Config\ConfigBase.php).
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 214)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 214)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 214)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 214)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 214)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 161)
Drupal\Core\Config\ConfigBase->setData(Array) (Line: 107)
Drupal\Core\Config\Config->setData(Array) (Line: 279)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('protein', Object) (Line: 392)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 259)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 358)
Drupal\Core\Entity\Entity->save() (Line: 637)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 986)
Drupal\views_ui\ViewUI->save() (Line: 312)
Drupal\views_ui\ViewEditForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 583)
Drupal\Core\Form\FormBuilder->processForm('view_edit_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'edit', Array) (Line: 226)
Drupal\views_ui\Controller\ViewsUIController->edit(Object, NULL)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Problem

We build an array of the selected items when using the InOperator where both the array keys and values are set to the selected item name. If the array key contains a period, this will cause an error when exporting this to config since sequences don't support periods in their keys

Proposed solution

Don't use an array with both keys and values set to the selected items, use a numeric array that only has the values set to the selected items

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 22 hours ago

Created by

πŸ‡¨πŸ‡¦Canada jmadden27

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024