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.
I encountered this bug in the Rules integration after updating to the latest dev version.
To reproduce:
- On a clean D7 install, enable rules, content_access and content_access_rules
- Turn on rules debug log
- Edit Article content type and check "Enable per content node access control settings"
- Create a rule that changes content access permissions on content creation
- Create an Article and save it
- You should find that the newly-created article's content access permissions have not changed, and this Rules debug error is logged: "Can't set per content permissions for content type article. Make sure to have per content settings activated for content types you want to alter access control for."
It seems that the function _content_access_rules_check_setting() in content_access_rules.rules.inc hasn't been updated to reflect recent changes in storage format for settings.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1348824_6.patch | 849 bytes | good_man |
#1 | fix_settings_check-1348824-2.patch | 0 bytes | auberdjinn |
#2 | fix_settings_check-1348824-3.patch | 0 bytes | auberdjinn |
Comments
Comment #1
auberdjinn CreditAttribution: auberdjinn commentedThe attached patch fixed the issue for me. Repeat step 5 after applying the patch and you should find the error is not there this time and content access permissions on the new article have changed according to the Rule.
Comment #2
auberdjinn CreditAttribution: auberdjinn commentedOk, so this time I paid attention to formatting. My apologies! Replaces above patch.
Comment #3
auberdjinn CreditAttribution: auberdjinn commentedOK, so I screwed up the patch naming as well, but let's just pretend it's attached to this comment, eh?
Comment #4
auberdjinn CreditAttribution: auberdjinn commentedOh, where did my patch go? I'm sorry, I didn't notice it was 0 bytes earlier! Not sure what happened there. Will try to upload it again once I get back to the machine it's residing on. I promise, depsite my apparent inability to perform the simple task of naming and uploading a patch, it really does work ;-)
Comment #5
good_man CreditAttribution: good_man commentedHello catfink, if you are unable to upload a patch, try pasting it (if it's a small code) in code tag. Also try hitting the upload button then submit the comment.
Comment #6
good_man CreditAttribution: good_man commentedHere is a patch to solve this. Waiting your review.
Comment #7
auberdjinn CreditAttribution: auberdjinn commentedThat's pretty much what my patch looked like :) Sorry you had to reproduce the effort, and thanks for doing so.
I've tested your patch and it fixes the issue for me.
Comment #8
good_man CreditAttribution: good_man commentedThanks for reporting, committed and it'll appear in the dev version after some hours :)
Comment #9
good_man CreditAttribution: good_man commentedTagged as needs tests.