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.
It would be nice to have conditions for "not 403" and "not 404". I have some blocks that I want to display on every page *except* these error pages. I think I can work around it now by doing an error_page context and then doing a "not context" condition, but it would be cleaner to just be able to say "not on the error pages".
Comment | File | Size | Author |
---|---|---|---|
#6 | refactor_for_1238918_6.patch | 3.55 KB | szantog |
#3 | notconditions.diff | 2.1 KB | George Bills |
#2 | notpatch.txt | 1.2 KB | George Bills |
Comments
Comment #1
George Bills CreditAttribution: George Bills commentedIt also looks like "~error_page" (when error_page is the name of the context) doesn't work in a "context" condition. Other "~context" specifiers work fine.
Comment #2
George Bills CreditAttribution: George Bills commentedI wrote a patch to reverse the logic here. It's pretty hacky and it removes the ability to say "only show on 404 error pages", but it seems to work. Attached.
Comment #3
George Bills CreditAttribution: George Bills commentedIgnore the last - here's a much nicer patch.
It lets the user pick between "An error page", "403 error pages only", "404 error pages only" or "not an error page".
One problem is that the selection is done with checkboxes, but the logic only makes sense if one and only one value is picked. The selection should really be done using a select dropdown, but I didn't know how to do that inside the Context API.
Comment #4
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedcan we get this into release, please?
Comment #5
snufkin CreditAttribution: snufkin commented@PersonalPronoun Thanks very much for the patch! Could you take care that coding standards (http://drupal.org/coding-standards) are kept in the code and reroll the patch please?
Comment #6
szantog CreditAttribution: szantog commentedThe refactored patch against today's update for d7.
Comment #7
snufkin CreditAttribution: snufkin commentedCommitted, thanks! Now if someone wants to backport it to D6 feel free, I am not going to work on that branch anymore.