Closed (fixed)
Project:
Panelizer (obsolete)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Dec 2015 at 20:37 UTC
Updated:
27 Sep 2016 at 15:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
neclimdulhttps://www.drupal.org/node/add/project-issue/panelizer #sadtrombone
Comment #3
japerryI believe this isn't a panelizer issue. Project module shouldn't be adding additional url paths, because modules assume node/*/*/(project) is for node/edit/534534/(project)
Comment #4
japerryComment #5
damienmckennaThere must be a permission thing here, the problem doesn't happen for me.
Comment #6
drummYep, view/access admin theme is a separate permission.
I'm not aware of a precedent for additional things being added to the node/add path as being particularly good or bad.
If we do change this to a query parameter, redirects must also be added.
Comment #7
damienmckennaPanelizer matches the following path for the admin path:
.. where $path is the entity path with all arguments converted to stars, therefore it would be node/*/panelizer* and not node/*/*/panelizer as suggested. Would that still trigger the match?
Comment #8
drummnode/*/panelizer*is indeed what it uses, and panelizer does take overnode/{nid}/panelizer.I expect this reaches
drupal_match_path(), which I think secretly supports regular expressions.node/[0-9]+/panelizer*may work. That's non-ideal since it is exploiting secret functionality, and maybe Panelizer can't assume entities have numeric IDs in URLs. I can't think of another way to be more specific about which paths are admin paths.Comment #9
damienmckennaSounds like this needs to go back to being a Panelizer issue then.
So it boils down to adding a hook_admin_paths() callback for the PanelizerEntityNode class and using a string that drupal_match_path() will accept.
Comment #10
damienmckennaSomething like this might work.
Comment #11
damienmckennaComment #13
neclimdulBranch didn't get switched back.
Comment #15
damienmckennaCommitted. Thanks drumm for the regex suggestion.
Comment #16
damienmckennaDarnit. I should have added tests first.
Comment #17
damienmckennaRolling back the change.
Comment #19
damienmckennaThe regex doesn't work because drupal_match_path() runs preg_quote() on the string, breaking the fancy regular expression.
Darnit.
Comment #20
damienmckennaComplete rollback, with the tests.
Comment #21
damienmckennaI've committed the changes above.
Should maybe d.o add this to a custom module?
Comment #23
damienmckennaMaybe it just needs to check the node_admin_theme setting?
Comment #24
damienmckenna@drumm: What is node_admin_theme set to on d.o?
Comment #25
drummnode_admin_theme is
0Comment #26
damienmckennaAh! That explains it then.
This should cover it.
Comment #28
damienmckennaFixed the tests.
Comment #29
damienmckennaOk. This works. Thanks all.