Problem/Motivation

I placed a block which referred to a context I already deleted. This value remained at Context (all). This broke the application and resulted in the following error: Error: Call to a member function getConditions() on null in Drupal\context\Plugin\Condition\ContextAll->getCacheContexts() (line 78 of modules/contrib/context/src/Plugin/Condition/ContextAll.php).

Steps to reproduce

  1. Fresh install Drupal with Context module enabled
  2. In block layout edit a block which is currently displayed
  3. At Context (all) fill out a name of a non-existing context
  4. Save the configuration and notice your site is broken

Issue fork context-3283436

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bizar1984 created an issue. See original summary.

bizar1984’s picture

Status: Active » Needs review
paulocs’s picture

Thanks!

  • paulocs committed c691ced on 8.x-4.x authored by bizar1984
    Issue #3283436 by bizar1984: ContextAll condition brakes on unknown...
paulocs’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

aitala’s picture

I got hit with this error all of a sudden on a site that's been working for quite a while.

After I applied the patch, the site came back online, and there was an all site context that didn't do anything but that should not have changed recently...

??

Thanks,
Eric

demonde’s picture

I still get this error message using a context block condition using a wildcard like subsite_* on context(any) and context(all) condition.

randalv’s picture

Can confirm I also still get this, I'm using the google_tag module and in Context (any) the value was: *

Simply removing * and leaving it empty works for me, but that won't work for anyone using a value like: generic_name_*

surfgatinho’s picture

Still broken.

Error occurs when using wildcard * as described above.

anup.singh made their first commit to this issue’s fork.