Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
@APolitsin the problem is most likely in Pathauto config file format. The old configs can be converted to a new format by pathauto_update_8108 hook update.
This is not a pathauto issue per comments above, you do not need to downgrade it. The current release has been our since April.
If you do not need ctools otherwise I recommend testing pathauto 8.x-1.x-dev and uninstall ctools. More positive test feedback will result in that being released earlier.
The php 8 issue mention above should be fixed there as well.
I encountered the same issue, running
Chaos tools 4.01 as well as
Pathauto 8.x-1.11
under Drupal 9.4.8
PHP 8.1.11
Removing Pathauto resolved the issue. I cannot remove Chaos tools as it is a dependency for a few other modules.
This is the log for the failure:
Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase->getContextDefinition() (line 184 of ./core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
Yes removing pathauto also resolved issue for me. Thanks
Edit: Installed pathauto again and found no issue. so it seems some issue with existing configurations saved. so uninstalling and installing pathauto solved the issue.
Comments
Comment #2
apolitsin commentedCannot create new content (nodes)
on new drupal installations (Drupal core 9.4.4, PHP 8.0.12)
```
Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase->getContextDefinition() (line 184 of core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
Drupal\Core\Executable\ExecutablePluginBase->getContext(NULL) (Line: 116)
Drupal\Core\Executable\ExecutablePluginBase->getContextValue(NULL) (Line: 91)
Drupal\Core\Entity\Plugin\Condition\EntityBundle->evaluate() (Line: 77)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 376)
Drupal\pathauto\Entity\PathautoPattern->applies(Object) (Line: 320)
Drupal\pathauto\PathautoGenerator->getPatternByEntity(Object) (Line: 41)
Drupal\pathauto\PathautoWidget->formElement(Object, 0, Array, Array, Object) (Line: 353)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 220)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 181)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('node_test_form', Object) (Line: 278)
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: 564)
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: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 54)
Drupal\cache_alter\StackMiddleware\ClearRequest->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```
Comment #3
apolitsin commentedQuick solution - remove pathauto widget from `form-display`
Comment #4
apolitsin commentedError at settings page: `/admin/config/search/path/settings`
```
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 152 of modules/contrib/pathauto/src/Form/PathautoSettingsForm.php).
in_array('block_content', NULL) (Line: 152)
Drupal\pathauto\Form\PathautoSettingsForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('pathauto_settings_form', Object) (Line: 278)
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: 564)
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: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 54)
Drupal\cache_alter\StackMiddleware\ClearRequest->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```
Comment #5
kalabro@APolitsin the problem is most likely in Pathauto config file format. The old configs can be converted to a new format by pathauto_update_8108 hook update.
Example configs fix for Anu LMS: https://github.com/systemseed/anu_lms/pull/191/commits/21e39eb0d18c43d5a...
Comment #6
kalabroRestoring pathauto version
Comment #7
MykolaVeryha commentedThe cause
https://www.drupal.org/project/ctools/issues/3300682
Comment #8
rajab natshahFacing the same issue with Drupal 9.4.4
Temp fix in projects:
Comment #9
berdirThis is not a pathauto issue per comments above, you do not need to downgrade it. The current release has been our since April.
If you do not need ctools otherwise I recommend testing pathauto 8.x-1.x-dev and uninstall ctools. More positive test feedback will result in that being released earlier.
The php 8 issue mention above should be fixed there as well.
Comment #10
rajab natshahThanks, Sascha for clearing this issue off
Tested:
Even tho that pathauto
having the following as a temp fix worked
Following up on none Pathauto releated fixes in
#3300682: [error] Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context.
For other used locations like page_manager, panels, paragraphs, password_policy, total_control
Comment #11
jjmackow commentedI encountered the same issue, running
Chaos tools 4.01 as well as
Pathauto 8.x-1.11
under Drupal 9.4.8
PHP 8.1.11
Removing Pathauto resolved the issue. I cannot remove Chaos tools as it is a dependency for a few other modules.
This is the log for the failure:
Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase->getContextDefinition() (line 184 of ./core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
Comment #12
sker101 commentedDowngrading `ctools` from `4.x` to `3.11` fixed the issue for me, according to https://www.drupal.org/project/ctools/issues/3300682#comment-14647155
Comment #13
zeshan.ziya commentedYes removing pathauto also resolved issue for me. Thanks
Edit: Installed pathauto again and found no issue. so it seems some issue with existing configurations saved. so uninstalling and installing pathauto solved the issue.
Comment #14
dydave commentedThanks to the solution pointed out at #7 and #12, from related ticket #3300682-90: [error] Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context., we were able to find the changes needed to the pathauto pathauto.pattern.*.yml.
Very much the same config as described at #11:
Tested with:
We encountered the same fatal error with the following stack trace, which led to this ticket:
Updating manually the files in pathauto.pattern.*.yml config files fixed the issue in our case.
Any additional feedback, questions, comments, suggestions or code contributions would be welcome.
Thanks again for sharing the solution to the issue.
Comment #15
charly71 commentedPathauto 8.x-1.13
Chaos Tool Suite (ctools) 8.x-3.15
Drupal 9.5.11
The issue is still active. Tried to /node/add/page