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.
Problem/Motivation
Contact module doesn't implement AccessControlHandler for messages which prevents this module to be used with entityform_block module.
Proposed resolution
Access handler implementation that checks for "access site-wide contact form" for create access.
Additionally, we should add admin permission.
Comments
Comment #1
larowlanThanks, we might have this in contact_storage already.
Comment #2
Berdircontact_storage only has the admin permission.
Comment #3
mbovan CreditAttribution: mbovan commentedAdded AccessControlHandler class and admin_permission for Message entity entity type.
Comment #4
BerdirWe're not testing that at the moment, not sure how we want to do that.
Maybe we could check for contact message create access instead of contact_form view access on contact.site_page_form?
Comment #5
BerdirComment #6
mbovan CreditAttribution: mbovan commentedAdded tests coverage.
Comment #7
BerdirComment #9
BerdirFailed as expected.
@mbovan: If you upload the test only patch first, then the issue status will not be set back to needs work.
Comment #10
larowlanCan you make the array format consistent on these lines? We shouldn't mix old form
array()
and new form[]
in the one line. Personal preference is on [], but let you decide ;)Minor nit, other than that - looks great - thank you for the patch and the test!
Comment #11
BerdirComment #12
dashaforbes CreditAttribution: dashaforbes commentedChanged array syntax lines 68 and 69 as per comment #10
Comment #13
dashaforbes CreditAttribution: dashaforbes commentedchanged patch name
Comment #14
dashaforbes CreditAttribution: dashaforbes commentedComment #17
dashaforbes CreditAttribution: dashaforbes commentedComment #19
dashaforbes CreditAttribution: dashaforbes commentedComment #20
dashaforbes CreditAttribution: dashaforbes commentedComment #21
Berdir@dashaforbes: Remember to provide an interdiff when working on an existing patch, had to download and diff myself to make sure that only the requested changes were made. See https://www.drupal.org/documentation/git/interdiff.
Comment #22
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 4f33bd4 and pushed to 8.0.x. Thanks!