There seems to be a problem with how context is passed between Page Manager and the Panels IPE. The problem that I see is that on page manager pages that have context (i.e. a search keyword context for a search page) things work fine until an user uses the IPE to edit a page and *then* on save the context is lost and all of the pages become empty (since they have no context). The problem is solved by refreshing the page, but that can be confusing for users and breaks the experience.

Comments

merlinofchaos’s picture

Some information from http://drupal.org/node/1520492#comment-6361028

1) The one I saw yesterday is similar to what was reported here. After a save, the IPE forces a complete rerender. However, arguments are lost, so context derived from arguments revert to placeholder values. This is probably fixable, but I have to figure out how to preserve the argument information. However, as said above, I don't think there's anything I can do about things that acquire information directly from the URL. The workaround would be to try and acquire that information from context instead, but I realize that's not always possible.

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new5.06 KB

The attached patch should fix the problem of lost contexts.

It won't (currently) fix the problem of URL based contexts disappearing, but the framework is there to fix it; I'd like some confirmation this works for otehrs.

Note: Once the patch is applied, it changes the cache keys. That means you must refresh any page with an IPE you want to use after applying the patch or it will try to load a no longer valid cache.

populist’s picture

Status: Needs review » Reviewed & tested by the community

I gave the patch in #2 a review and think its a good improvement. It fixes the couple of cases that I had where context was being passed and makes the IPE editing of things like a search page so much better.

populist’s picture

Status: Reviewed & tested by the community » Needs work

I checked this out as per #3 and it solves the issue. It does introduce an odd problem on the backend when you try to check out a page that has a context though. Funny it still works in the IPE, just not the admin side:


Notice: Undefined offset: 3 in panel_context_panels_cache_get() (line 1538 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Undefined offset: 2 in panel_context_panels_cache_get() (line 1538 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Undefined offset: 1 in panel_context_panels_cache_get() (line 1538 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Undefined property: stdClass::$task_id in panel_context_panels_cache_get() (line 1552 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Undefined property: stdClass::$subtask in panel_context_panels_cache_get() (line 1559 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Trying to get property of non-object in ctools_context_handler_get_handler_object() (line 368 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/ctools/includes/context-task-handler.inc).
Notice: Undefined property: stdClass::$locked in panel_context_panels_cache_get() (line 1567 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/panels.module).
Notice: Undefined index: theme in panels_renderer_standard->render_layout() (line 392 of /usr/local/var/www/panopoly/profiles/panopoly/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php).

merlinofchaos’s picture

Status: Needs work » Fixed

Ahh, that's just because I missed a spot where the cache_key is constructed in an odd way. A grep didn't show many any others of that, so I think that one is isolated. Fixed that, and committed and pushed this.

populist’s picture

StatusFileSize
new5.85 KB

Here is the patch that was pushed in #5 for install profile reasons.

Status: Fixed » Closed (fixed)

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

xatiu’s picture

The patch does not work for me. What do you mean with "you must refresh any page with an IPE"? Just refresh the page with f5?

Dimitrius’s picture

Version: 7.x-3.x-dev » 7.x-3.3
StatusFileSize
new997 bytes
new5.54 KB

It's already fixed in the latest dev version but the problem is still available in the stable release (7.x-3.3). Here is a patch for the 7.x-3.3 (in case if you can't use a dev version for some reasons) which also include a fix from the #1801422: Context Trouble with Node Edit Page

duynguyen’s picture

The patch #9 lost context on variant conent

  • Commit 451f8d4 on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1772834 by merlinofchaos | populist: Fixed Panels IPE Save Drops...