I saw a problem #1822058: Restrict Layouts to Those Set in Panelizer Allowed Layouts come up which looks to be a deeper issue with Panelizer. The problem here is that Panelizer allows a user to "Select Allowed Layout" as part of its "Allowed Content" option per node type, but it doesn't seem to respect those settings when used in the "Change Layout" function of the IPE (doing it on the backend respects the settings). Instead, the IPE uses the global layout settings set at admin/structure/panels/settings/panel-page.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | panelizer-n1822136-8.patch | 2.94 KB | damienmckenna |
| #5 | panelizer-1822136-5.patch | 2.94 KB | tim.plunkett |
| #2 | 1822136-set-panelizer-layout-per-settings-2.patch | 575 bytes | populist |
Comments
Comment #1
populist commentedI did some more research here and can report the following:
Layouts for the IPE are set in ajax_change_layout() of plugins/display_renderers/panels_renderer_ipe.class.php in the Panels.module. The logic there goes like this:
My guess the problem here is that the $this->display->allowed_layouts's isn't properly getting set in panelizer_panels_cache_get() since a quick look at that logic shows we have explicit handling of the allowed content types, but not the layout.
Comment #2
populist commentedHere is a patch that likely does the trick. Uses the same pattern as the content types, but adds in the layouts too. It requires you clear your CTools cache to make it work, but I tested it on Panopoly and saw it setting correctly.
Comment #3
merlinofchaos commentedThis is a simple fix. Committed and pushed.
Comment #4
damienmckennaShould we backport this to v2 too?
Comment #5
tim.plunkettI'm seeing the opposite problem. I can open a new issue later, but this touches some of the same code, and seems like just a follow-up.
Basically, the "Use the same allowed layouts as standard Panels pages?" setting is ignored, and all layouts are presented.
Comment #6
ec1ipsis commentedI'm seeing the exact same issue mentioned in #5. Will test the patch and report back.
Comment #7
ec1ipsis commentedThe patch applied cleanly and solves the problem for me using Drupal version 7.22, Panelizer version 7.x-3.1.
Comment #8
damienmckennaJust a quick reroll.
Comment #9
damienmckennaCommitted.