After updating from panels 3.5 -> Panels 3.6 today, I noticed that any underscores in pane CSS IDs are being converted to hyphens. We have a number of sites where our themes target these CSS IDs for styling, so the themes have broken. Is this expected behavior for the upgrade (theres nothing in the UPGRADE.txt about it)?

To be clear about the CSS ID's I'm talking about, I took a couple screenshots to demonstrate where I'm editing this CSS ID. When the page renders, the actual ID has hyphens in it instead of underscores.

Comments

bkosborne created an issue. See original summary.

bkosborne’s picture

Ok, it's because of this issue: #1441218: Use keyword replacements for CSS settings

The CSS IDs used to be just run through check_plain, but now they are run through drupal_html_id which among other things will convert underscores to hyphens.

Not sure what the best fix is at the moment. Maybe only perform the call to drupal_html_id if the CSS ID contains a token?

dsnopek’s picture

Hm. I'm not sure drupal_html_id() is even correct in this case. In Panels IPE, when you change a pane it's rendered again and placed via AJAX, and this would cause it to have a new ID when editing via the IPE, but use the plain ID when viewing the page normally. SInce these IDs are set by administrators (rather than code - which is the common case for drupal_html_id()) it should be on the administrator to make sure they are unique (which was the case in Panels 3.5 and below).

A patch that removes that and goes back to check_plain() makes sense to me!

dsnopek’s picture

Status: Active » Needs review
FileSize
1.45 KB

I see now that this is just for pages and handlers, not panes - but I think the same logic from #3 applies. When the ID is user configurable, making the ids unique should be up to the user. If Drupal is changing it dynamically, then the user can't even depend on the thing they set and what's the point of that?

Here's a patch to test!

caschbre’s picture

Patch corrected the styling issues we were experiencing.

bkosborne’s picture

Status: Needs review » Closed (duplicate)
DamienMcKenna’s picture

Version: 7.x-3.6 » 7.x-3.x-dev
Status: Closed (duplicate) » Needs review

#2786249 was created after this one.

DamienMcKenna’s picture

Sorry, got the issues mixed up.