Download & Extend

Panels IPE Doesn't Maintain Form IDs

Project:Panels
Version:7.x-3.x-dev
Component:In-Place Editor (IPE)
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

In a standard page load, each form that is built calls drupal_html_id() to get an unique form id across the entire page load. However, in the case of the IPE, there is a fair bit of form rebuilding that does not require a page load. As a result, a situation arises where a single form on the page (for example, #search-form) begins to change its ID each time the IPE is invoked (becoming #search-form--2 and then #search-form--3 and so on). This breaks various CSS assumptions (i.e. Bartik's theming of #search-form) and plenty of JS targeting.

This patch resets the $_POST['ajax_html_ids'] array upon saving the IPE which solves the problem of duplicate IDs since when drupal_html_id() inspects it upon rebuilding it can correctly generate the right and assumed ID. I am not sure if this is the right way to invalidate this, but wanted to open an issue with a patch to consider resolutions.

AttachmentSize
panels-ipe-reset-html-ids.patch771 bytes

Comments

#1

Here is a slight update that moves the html clearing a little higher up in the load order to make sure the ids get reset properly.

AttachmentSize
panels-ipe-reset-html-ids-take2.patch 879 bytes

#2

And one more that also includes the case of changing layouts (as well as customizing the page) in the IPE.

AttachmentSize
panels-ipe-reset-html-ids-take3.patch 1.33 KB

#3

Here is an update to keep with the -dev magic. .

UPDATE - PLEASE IGNORE PATCH 4. That was done against the Drupal 6 branch and, as we know, D6 is the past!

AttachmentSize
panels-ipe-reset-html-ids-take4.patch 856 bytes

#4

Status:needs review» fixed

Committed and pushed.

#5

Status:fixed» closed (fixed)

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

nobody click here