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
FormModeAccessCheck and ViewModeAccessCheck have docblocks which read:
Allows access to routes to be controlled by an '_access' boolean parameter.
This looks like an accidental copypaste from the default access check.
Proposed resolution
Correct the class docblocks to describe what the classes actually do.
Remaining tasks
- Create patch.
- #2222719: Use parameter matching via reflection for access checks instead of pulling variables from request attributes adds documentation for the
access()
methods of these classes (since they no longer inherit from the interface) and should be a good reference to explain their purpose.
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff-4-9.txt | 1.79 KB | martin107 |
#9 | accessCheck-2267571-9.patch | 1.31 KB | martin107 |
#4 | accessCheck-2267571.patch | 1.79 KB | martin107 |
Comments
Comment #1
xjmComment #2
martin107 CreditAttribution: martin107 commentedComment #3
xjmComment #4
martin107 CreditAttribution: martin107 commentedAnodyne first draft...
@xjm Did you have something more specific in mind just let me know.
Comment #5
martin107 CreditAttribution: martin107 commentedComment #7
martin107 CreditAttribution: martin107 commented4: accessCheck-2267571.patch queued for re-testing.
A patch which changes only comments ... Oh testbot you are drunk.
Comment #8
xjmThanks for the patch @martin107! A few comments:
Our docs standards indicate that the one-line summary should start with a third-person verb: https://drupal.org/node/1354#classes
(A lot of the other access checker classes are missing verbs too, but let's keep this one here correct.)
Also, the docblock is not quite correct... these classes don't determine access rules per se. They simply perform the access check for the routing system. So perhaps something more like:
We don't need to explain what form modes are here; this is just an access checker and the concept of form modes is discoverable through the UI.
I think we can actually omit these three @see, since they're not as directly relevant and they're also available from the EntityFormMode class (and EntityViewMode similarly).
Let's remove that period at the end of the @see.
Comment #9
martin107 CreditAttribution: martin107 commentedThank you for the review.. less is more - it reads much better...
Comment #10
xjmThat looks good I think!
Comment #11
jhodgdonThanks! We can't commit this until after the next Alpha (critical/major only through Wednesday this week).
Comment #12
martin107 CreditAttribution: martin107 commentedNominated this issue for a quick fix as it will be affected by the looming deadline on May 27 ( ie will need reroll )
https://drupal.org/node/2247991
Comment #13
jhodgdonThanks again! Committed to 8.x.
Comment #16
martin107 CreditAttribution: martin107 commented