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, save

You'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!

Comments

merlinofchaos’s picture

Priority: Normal » Major

The 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.

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

The 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.

chrisschaub’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. Thanks a bunch.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the test. Committed and pushed.

razvan_379’s picture

Hello.

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?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 19fe737 on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1930448: Panel nodes not properly clearing cache after save with...