Trying to save GraphAPI default options form results in WSoD

Created on 29 August 2024, 7 months ago

Problem/Motivation

Trying to save GraphAPI default options form results in WSoD. This looks very similar to 🐛 Trying to save any theme settings form results in WSoD Fixed .

That said, I think we should focus on Improve usability of Config Enforce Devel's UI Postponed , rather than put any effort into playing whac-a-mole with the vagaries of config form submit handlers.

Steps to reproduce

  1. Enable GraphAPI and Config Enforce Devel
  2. Visit the "Edit Graph API PNG by graphviz default options" form (/admin/config/system/graphapi/graphapi_png/defaults)
  3. Click "Save defaults"
  4. Observe the following error stacktrace:

The website encountered an unexpected error. Try again later.

Drupal\Core\Config\ConfigValueException: graphapi.graphapi_format_defaults.graphapi_png key contains a dot which is not supported. in Drupal\Core\Config\ConfigBase->validateKeys() (line 209 of core/lib/Drupal/Core/Config/ConfigBase.php).

Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 212)
Drupal\Core\Config\ConfigBase->validateKeys(Array) (Line: 161)
Drupal\Core\Config\ConfigBase->setData(Array) (Line: 107)
Drupal\Core\Config\Config->setData(Array) (Line: 277)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('graphapi_png', Object) (Line: 486)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 257)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 614)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object) (Line: 65)
Drupal\graphapi\Form\GraphapiFormatDefaultsEditForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('graphapi_format_defaults_edit_form', Array, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
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}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Post a patch here that just adds graphapi_format_defaults_edit_form to config_enforce_config_enforce_form_denylist().

This, at least, provides a workaround that will allow saving the form. The config (graphapi.graphapi_format_defaults.graphapi_png) can still be enforced using the "Generate from active storage" mechanism.

Remaining tasks

  • Post a patch
  • Mark as "postponed", until related issues are resolved.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦

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

Comments & Activities

Production build 0.71.5 2024