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 get access denied when I press manage fields on views display bundle. Is this just unfinished functionality or is there something that I am missing?
Comment | File | Size | Author |
---|---|---|---|
#4 | 2792665-4--types_admin_ui_access.patch | 622 bytes | drunken monkey |
Comments
Comment #2
drunken monkeyNo, you're right, there seems to be a problem.
At closer inspection, it seems that
field_ui_admin_access()
is to blame (which handles access to "Manage fields" and "Manage display", which are provided by the Field UI module): contrary to other page and access callbacks, the arguments here won't be automatically replaced with the corresponding path segments, so there's no way to check dynamically for the existence of the bundle in question.Two ways around that (in this module – proper fix would probably be in the hands of the Field UI module), as far as I can see:
- Manually replace numeric IDs with that segment from the current page path. Will produce rubbish when the menu item is retrieved from a different page, but I don't think that will happen (except in the other tabs for that bundle, where the segment will be the same).
- Remove the "bundle exists" restriction from the access callback – however, I fear this would mean you could just put some rubbish as the bundle ID parameter and trigger all kinds of errors and notices. The Field UI module, while not providing (as far as I can see) any mechanism to work around that, doesn't seem to handle inexistent bundle parameters correctly/gracefully.
The attached patch implements the first option. Please see if it fixes the problem for you!
Comment #3
drunken monkeyEdit: Disregard this.
Comment #4
drunken monkeyOops, wrong patch in the previous comment – this is the right one.
Comment #5
drunken monkey(Problem exists in dev version, too.)
Comment #7
drunken monkeyCommitted.