- Issue created by @shafiqhossain
- π«π·France berramou
Here is how to reproduce this error:
- Create a Visibility Group with at least two condition one Request Path and another one with Content type
- Apply this group to a block
- Go to any pages that's not a node page or page listed in request path condition
You will have this error, it seems that the node (maybe any other entity type) it's required in the context, it seems that module evaluate the condition even if the context don't have value.
this line of code who throw the exception
$this->contextHandler->applyContextMapping($condition, $contexts);
because the $contexts will have
["@node.node_route_context:node" => "contextValue":protected]=> NULL ]
- π«π·France berramou
Here is a patch needs reviews, the idea is to filter out the contexts without value before passing them to applyContextMapping.
- πΊπΈUnited States jbowm2
I am seeing a similar issue but it's not quite the same:
Drupal\Component\Plugin\Exception\ContextException: Assigned contexts were not satisfied: node in /app/web/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php:145
the error log is quite long. Hoped this patch might solve my issue but i am still seeing the same error in the logs
- π«π·France berramou
Ah i don't have this error,
I guess it's better to create a new issue and make it a follow up to this one, and describe what Block Visibility Groups you have. - πΊπΈUnited States Kasey_MK
We were encountering this error on Views-created search pages (like one at /path) with Block Visibility Groups with two "request path "conditions (Return true on the following pages: /path* and Do not return true on the following pages: /path/*)
The patch in #4 does make the errors go away, and I still see the things governed by the correct Block Visibility Group on the Views page at /path and /path?query=etc but not on a node at /path/test - just as I expect.
Thanks!
- πΊπΈUnited States smustgrave
patch #4 worked for us too. Want to turn to an MR.
-
damienmckenna β
committed 7821fa9f on 2.1.x
Issue #3476824 by berramou, shafiqhossain, jbowm2, kasey_mk,...
-
damienmckenna β
committed 7821fa9f on 2.1.x
Automatically closed - issue fixed for 2 weeks with no activity.