- Issue created by @maxilein
- π¦πΉAustria maxilein
maybe this helps https://www.drupal.org/project/drupal/issues/2925890 π Invalid config structures can result in exceptions when saving a config entity Needs work
- Status changed to Postponed: needs info
about 1 year ago 1:29pm 23 May 2023 - ππΊHungary GΓ‘bor Hojtsy Hungary
I think π Config inspection should wipe relevant caches to always get up-to-date results Fixed should have helped for this? Can you check?
- π¦πΉAustria maxilein
Thanky you. I tested the new release. I get the same error. And in the meantime I suspect it is a wrong config.
My question is: since config inspector is a tool to find problems in the config, shouldn't it be able to continue on such an error and list the invalid entry instead of crashing?
- Status changed to Needs work
about 1 year ago 6:27am 25 May 2023 - ππΊHungary GΓ‘bor Hojtsy Hungary
It should definitely not crash on invalid config indeed. The exception comes from
ArrayElement::get()
in Drupal core./** * {@inheritdoc} */ public function get($name) { $parts = explode('.', $name); $root_key = array_shift($parts); $elements = $this ->getElements(); if (isset($elements[$root_key])) { $element = $elements[$root_key]; // If $property_name contained a dot recurse into the keys. while ($element && ($key = array_shift($parts)) !== NULL) { if ($element instanceof TypedConfigInterface) { $element = $element ->get($key); } else { $element = NULL; } } } if (isset($element)) { return $element; } else { throw new \InvalidArgumentException("The configuration property {$name} doesn't exist."); } }
checkValues() does not document as even re-throwing an InvalidArgumentException but it is documented to rethrow SchemaIncompleteException, which it should also convert into an error to display rather than throw.
- π¦πΉAustria maxilein
I don't understand where the value is expected. Where should the property exist? In the config table? In the theme yml?
Maybe I can help more by getting more information. - πͺπΈSpain aleix
While it doesn't solve what GΓ‘bor said: @maxilein this configuration comes from asset_injector module, following steps as https://www.drupal.org/project/asset_injector/issues/3329577#comment-150... π Fatal error: Schema error for theme condition selection field Fixed helps .
- π¦πΉAustria maxilein
Aleix, thank you. That makes sense! I will investigate and report here.
- π¦πΉAustria maxilein
Well I am already using the latest versions of asset injector.
What i can report about the situation: there was an old theme installed and used as default. The designer completely reworked his theme to a new version but kept the old theme name. Since there was no upgrade path the new one was copied over the old one...
So there may be some left over configs. I will try and re-save all assets and see if that makes a difference.
- π¦πΉAustria maxilein
So saved all asset injectors. There are still 2 Errors:
Error message Warning: Undefined array key "compare_format" in Drupal\name\Plugin\diff\Field\NameFieldBuilder->build() (line 73 of modules/contrib/name/src/Plugin/diff/Field/NameFieldBuilder.php). Drupal\name\Plugin\diff\Field\NameFieldBuilder->build(Object) (Line: 94) Drupal\diff\DiffEntityParser->parseEntity(Object) (Line: 104) Drupal\diff\DiffEntityComparison->compareRevisions(Object, Object) (Line: 181) Drupal\elogger\Services\Elogger->entityDiff(Object) (Line: 472) Drupal\elogger\Services\Elogger->prepareEntityLogMessage('entity_update', Object) (Line: 532) Drupal\elogger\Services\Elogger->logEvent('entity_update') (Line: 73) _log_entity_event('entity_update', Object) (Line: 50) elogger_entity_update(Object) call_user_func_array(Object, Array) (Line: 426) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'elogger') (Line: 405) Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object) (Line: 433) Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 251) Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 900) Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 598) Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781) Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 523) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 804) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339) Drupal\Core\Entity\EntityBase->save() (Line: 46) Drupal\user\ProfileForm->save(Array, Object) call_user_func_array(Array, Array) (Line: 114) Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597) Drupal\Core\Form\FormBuilder->processForm('user_form', Array, Object) (Line: 325) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) 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: 169) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->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: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19) Warning: Undefined array key "compare_format" in Drupal\name\Plugin\diff\Field\NameFieldBuilder->build() (line 73 of modules/contrib/name/src/Plugin/diff/Field/NameFieldBuilder.php). Drupal\name\Plugin\diff\Field\NameFieldBuilder->build(Object) (Line: 94) Drupal\diff\DiffEntityParser->parseEntity(Object) (Line: 105) Drupal\diff\DiffEntityComparison->compareRevisions(Object, Object) (Line: 181) Drupal\elogger\Services\Elogger->entityDiff(Object) (Line: 472) Drupal\elogger\Services\Elogger->prepareEntityLogMessage('entity_update', Object) (Line: 532) Drupal\elogger\Services\Elogger->logEvent('entity_update') (Line: 73) _log_entity_event('entity_update', Object) (Line: 50) elogger_entity_update(Object) call_user_func_array(Object, Array) (Line: 426) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'elogger') (Line: 405) Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object) (Line: 433) Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 251) Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 900) Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 598) Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781) Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 523) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 804) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339) Drupal\Core\Entity\EntityBase->save() (Line: 46) Drupal\user\ProfileForm->save(Array, Object) call_user_func_array(Array, Array) (Line: 114) Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597) Drupal\Core\Form\FormBuilder->processForm('user_form', Array, Object) (Line: 325) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) 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: 169) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->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: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Is there an open issue to catch that in core and return an unknown error?
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Found π Invalid config structures can result in exceptions when saving a config entity Needs work but that seems like its not addressing the issue in the schema check trait, which I would have expected
I'll open a new issue
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Ah! the issue is we had the patch (comment 29) from the above issue applied