Hello,
I'm using In-Place Editor to add/remove panes. Also it used for changing styles of panes. I created own style plugin which provides some settings and everything is ok at this step. But there is a problem when I change style of pane from own style which provides settings to some other default style which does't provide any settings (for example System block). Right after saving and reloading page I see notice:
Notice: Undefined index: settings in panels_renderer_standard->render_pane() (line 572 of panels/plugins/display_renderers/panels_renderer_standard.class.php).
It hapens because IPE class makes unset($pane->style['settings']), but render class expects it.
Steps to reproduce:
- Install latest drupal 7 using default profile
- Enable page_manager + panels_ipe + all dependencies
- Enable attached example module. The module contains example style plugin with settings for pane
- Create a custom page using page manager (you can use any layout, title and path)
- Use "In-Place Editor" as renderer for panel
- Add "Who's online" pane to the any column and save panel
- Go to the created panel and start modify it using IPE (click on "Customize this page" at the bottom of the page)
- Modify a style of the "Who's online" pane
- Change the style from "No style" to the "Example"
- Write any value into "Some setting" field on the setting form
- Save changes and refresh a page. The value of the setting has to displayed after "Who's online" pane
- Modify a style of the "Who's online" pane again and change it to the "Rounded corners". Save changes and refresh a page. Notice is appear
Note: I attached a screencast to demonstrate a problem. The example style also is attached
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | screencast 2020-06-26 14-56-15.mp4 | 42.16 MB | zestagio |
| #7 | example.tar_.gz | 752 bytes | zestagio |
| #2 | panels-notice-undefined-index-settings-in-panels_renderer_standard-3032350-2-D7.patch | 686 bytes | zestagio |
Comments
Comment #2
zestagio commentedComment #3
lmakarovCan confirm the patch in #2 works. A simple fix for a long standing, annoying issue. Thanks!
Comment #4
lmakarovReverting back to Needs Review, as the notice came back after additional testing.
The actual source of the issue (in my case) was in the way the custom style was applied by default to all new panes:
The fix was to set the $pane->style['settings'] value to an empty array:
Also, I was not able to reproduce the issue by setting pane style to System block or No style, so the patch #2 seems to be unnecessary.
Comment #5
lmakarovComment #6
joelpittetCould you provide steps to reproduce the bug?
Comment #7
zestagio commentedComment #8
zestagio commentedI updated a description and provided steps to reproduce
Comment #9
joelpittetNice work on the steps and video was awesome @zestagio! I'll dig into this shortly and likely commit something before the next release (soon)
Comment #10
joelpittet@zestagio, I tried to reproduce the steps just now and couldn't get that error to show up, so I'll watch the video and see if I can glean the problem from that.
Comment #11
joelpittetAh I had caching turned on which quells the problem, I'm able to see the issue now.
Comment #13
joelpittetI appreciate the hard work digging to the bottom of the bug. I've committed it to the dev for the imminent release of 3.10