Moved from #1484394: Undefined index in display-edit.inc, reported by cschaub
Ok, just did a clean install of Drupal 7.20 with latest dev of panels and ctools (also have same problem with recommended versions).
1. Create a custom panel node, IPE as the pipeline
2. Add a custom content pane, save
3. Add another custom content pane, saveYou'll notice that the first custom content pane is gone after the second save. If you hard refresh the page in between adding the panes, then they are retained.
The watchdog log says:
Notice: Undefined index: 3 in panels_edit_display_form_submit() (line 163 of sites/all/modules/panels/includes/display-edit.inc). I put it under this bug because it seems like the same problem, same file and almost the same line number. But maybe I should open a new issue? I've tested on firefox and chrome in both Winders and Linux.
Anyway, I think this is a real bug with IPE keeping track of multiple edits / saves. I'm not using any wysiwyg or any other modules other than panels, ctools and views.
Thanks for any help!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1930448-panels-node-save-cache.patch | 1.1 KB | merlinofchaos |
Comments
Comment #1
merlinofchaos commentedThe problem appears to be that panel nodes aren't clearing the edit cache upon save, and stale data is in the edit cache. This is then used the second time an IPE is opened.
Panel nodes should be implementing a cache clear hook. Either it isn't or it isn't implemented properly. I haven't looked at that part of the code yet, but that is where the problem lies.
The workaround, for the moment, is to hard refresh the page after saving with IPE. This is not ideal, obviously, but allows work to continue.
Upgrading to major because this does cause data loss.
Comment #2
merlinofchaos commentedThe issue is that Panels Node is that the default cache_save is not clearing the cache upon save. Panels node needs to implement cache_save to behave accordingly.
This patch should fix the issue.
Note: Since this is about clearing a cache when the save button is clicked, if you already have stale cache data, it will not appear to fix the issue until the second time you save an IPE. So to test this patch: Do a hard refresh on your panel node, then go through the process of modifying and saving twice. The problem should no longer appear.
Comment #3
chrisschaub commentedWorks for me. Thanks a bunch.
Comment #4
merlinofchaos commentedThanks for the test. Committed and pushed.
Comment #5
razvan_379 commentedHello.
I am new to drupal. I am having similar problem:
Notice: Undefined index: new-1 in panels_edit_display_form_submit() (line 162 of /var/www/virtual/mhosting.ro/htdocs/sites/all/modules/panels/includes/display-edit.inc).
I do not know how or where to add the patch. Some help?