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

toprak created an issue. See original summary.

toprak’s picture

I'm looking for a solution for 20 days but nothing. It doesn't work with Drupal 9. Any help, please ?

toprak’s picture

Finally 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.

dgroene’s picture

This 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).

vladimiraus’s picture

Status: Active » Reviewed & tested by the community

Thanks for the patch.

Tested in Drupal 9.0.7

  • Fixes installation
  • Fixes accessing nodes with module suppot
seanb’s picture

+1 RTBC, just checked in Drupal 9.1.0

proxiss’s picture

Patch works in 9.1.0. Pls create a release soon. Thanks.

  • VladimirAus committed cdedd2b on 4.0.x authored by dgroene
    Issue #3161989 by dgroene, toprak, VladimirAus, seanB, proxiss: The...
vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.