Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to prevent a context from showing blocks on Access Denied / Page Not Found errors?
I tried installing Context 403 module, creating an active context on 403/404 pages, then negating that context in the other context that normally shows blocks. Nothing happened.
I'd like to suppress context(s) on 403/404 as well as have it work with Views 403/404 pages.
Is the only way to do this to create custom error pages and negate based on path?
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedLooking for this too (for D7). When you hit a 403, the path does not change and so any contexts that have been set up based on path still take effect.
Comment #2
snufkin CreditAttribution: snufkin commentedAre you using http://drupal.org/project/context_error ? If not try with that, it sounds like something that module should be responsible for.
Comment #3
mrfelton CreditAttribution: mrfelton commentedI'm not using context error, but the problem with that as I see it, is that you would have to apply it in a negative state to every single context on the site to stop the blocks showing up for a 403 on paths covered by each context.
Core blocks don't show up on 403 pages by default - should context blocks?
Comment #4
kevinquillen CreditAttribution: kevinquillen commentedThe problem with Context Error is that the context is active if you are on the site_404 or site_403 page itself- the context would need to also work if Drupal headers contain 404 or 403- and also, be able to negate the condition (show if 404, DONT show if 404).
I would like to show blocks (block404 module does this) with contexts on 403/404 pages so the layout is not interrupted.
I tried to add a headers check to Context Error, but had no luck in negating it.
Comment #5
j0rd CreditAttribution: j0rd commentedI have this problem. Anyone have a fix?
For me, same issue. Page is denied for anonymous users via menu access argument's, but then the context is adding blocks that anonymous user should not be seeing.
Comment #6
semei CreditAttribution: semei commentedI also required this feature, following.