Download & Extend

Contextual links and other JavaScript behaviors on panes don't work after clicking "Cancel" in IPE

Project:Panels
Version:7.x-3.x-dev
Component:In-Place Editor (IPE)
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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.

Comments

#1

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.

#2

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.

#3

Title:Contextual links for panes don't work after clicking "Cancel" in IPE» Contextual links and other JavaScript behaviors on panes don't work after clicking "Cancel" in IPE
Status:active» needs review

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

AttachmentSize
panels-ipe-cancel-behaviors-1621014-3.patch 5.16 KB

#4

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.

#5

Status:needs review» needs work

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

#6

Status:needs work» closed (fixed)

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

#7

Status:closed (fixed)» active

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

#8

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.

#9

Status:needs work» needs review

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

AttachmentSize
panels-ipe-cancel-behaviors-1621014-9.patch 5.18 KB

#10

Status:needs review» reviewed & tested by the community

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

nobody click here