After going into the IPE on a panel node and clicking "Cancel", the contextual links for the panes no longer work (seems javascript-related). Other contextual links on the page still work normally.


When the "Cancel" or "Save" button is pressed, the panes are rebuilt using ajax. The problem with the contextual links is that they use a "destination" parameter to point back to the current page, but that in this case the "current page" is the ajax callback and not the page where the pane has been inserted.

Version:7.x-3.2» 7.x-3.x-dev

Confirmed on dev. An easy way to reproduce in a sandbox is to simply add the "Who's Online" block and even before saving the contextual "Configure Block" link has the ajax callback as the destination parameter.

Title:Contextual links for panes don't work after clicking "Cancel" in IPEContextual links and other JavaScript behaviors on panes don't work after clicking "Cancel" in IPE
Status:Active» Needs review
new5.16 KB

It actually sounds like there are two different bugs being reported here:

  1. The last couple of comments refer to a bug that happens with newly added panes (e.g., if you just added the "Who's Online" block). A possible solution for that would be to have the Ajax callback fake the correct value of $_GET['q'] before rendering the pane (similar to what menu_set_active_item() does)...
  2. The original bug report sounds different, though. To reproduce that, start with a situation where the "Who's Online" block is already on the page. Then open the IPE and hit "Cancel". At this point, the contextual links won't work at all (i.e., nothing even happens when you click on them - there is no JavaScript behavior attached).

Both bugs happen for more than just contextual links, although contextual links are the easiest way to experience them.

The attached patch deals with #2. It's a pretty complicated bug, so I tried to explain in the inline code comments what I think is going on.

Perhaps we should split #1 to a different issue. (See also: some of the comments at #1520492: Saving a change in the IPE results in a blank page, fine after refresh, no error.)

The last couple of comments refer to a bug that happens with newly added panes (e.g., if you just added the "Who's Online" block).

Actually, slight correction: it's not just newly-added panes, but also occurs for any pane, provided you just clicked the "Save" button.

So the main difference between the two bugs reported here is that one happens on save/add, and the other happens on cancel.

Status:Needs review» Needs work

Unfortunately, changes made recently make this patch not apply. Can i get a reroll?

Status:Needs work» Closed (fixed)

I just checked the latest dev, the problem seems to have been resolved elsewhere so I'm closing this.

Status:Closed (fixed)» Active

My mistake, a related issue was fixed but not this one. Contextual links still don't work after clicking "Cancel".

Status:Active» Needs work

Yup, this still occurs. Let me see if it's possible to do a quick reroll to get the patch working again.

Status:Needs work» Needs review
new5.18 KB

Alright, the reroll was pretty trivial, and testing against the latest 7.x-3.x-dev it seems to work for me.

Status:Needs review» Reviewed & tested by the community

Just experienced the same problem, the patch works great and the added documentation is impeccable.

I can confirm that the patch in #9 worked for me.

Issue summary:View changes
Status:Reviewed & tested by the community» Fixed

Confirmed issue, tested patch. committed.

Status:Fixed» Needs work

I had to revert this issue because of errors in Firefox. When this patch is applied, in some cases it can cause the browser to grind to a halt.

Revert here:

You can easily reproduce this with a stock commons install and this patch. Just click the IPE, click around inside panels a bit, and click cancel. You'll see the IPE menu disappears and firefox will become very slow.