Problem/Motivation
Hi ,
test - url : domain . com / node / 2 / summary
I'm getting this error.
The website encountered an unexpected error. Please try again later.
Log Messages:
Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context. in Drupal\Component\Plugin\ContextAwarePluginBase->getContextDefinition() (line 92 of /home/user/public_html/testproject/docroot/core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php).
Notice: Undefined offset: 0 in Drupal\view_mode_page\Entity\ViewmodepagePattern->applies() (line 395 of /home/user/public_html/testproject/docroot/modules/contrib/view_mode_page/src/Entity/ViewmodepagePattern.php)
How can I fix it , Thanks....
Comments
Comment #2
toprak commentedI'm looking for a solution for 20 days but nothing. It doesn't work with Drupal 9. Any help, please ?
Comment #3
toprak commentedFinally I gave up to use this module and found a solution with PANELS module.
If anyone want a solution with Drupal 9 , may use panels module.
With the Panels module, you can show different view modes with a customized url structure.
Comment #4
dgroene commentedThis fixes the issue for me. Looks like Drupal core is looking for the context definition in an index called "context_definition" not "context." Also for entities, ContextDefinition is deprecated in favor of EntityContextDefinition (see https://www.drupal.org/node/2976400).
Comment #5
vladimirausThanks for the patch.
Tested in Drupal
9.0.7Comment #6
seanb+1 RTBC, just checked in Drupal 9.1.0
Comment #7
proxiss commentedPatch works in 9.1.0. Pls create a release soon. Thanks.
Comment #9
vladimiraus