On my site, I was getting this javascript error:

Uncaught Error: Syntax error, unrecognized expression: div#panels-ipe-display-function

Turns out that in line 32 of panels_ipe.js, Drupal.settings.PanelsIPECacheKeys is iterated using:

for (var i in Drupal.settings.PanelsIPECacheKeys) {

I debugged this line and saw that the first value of Drupal.settings.PanelsIPECacheKeys[i] was the correct key, but the next two were members of the Drupal.settings.PanelsIPECacheKeys object were functions. (specifically i was first 0, then "contains", then "mergesort").

If this line was changed to :

for (var i=0; i<Drupal.settings.PanelsIPECacheKeys.length; i++) {

Only correct values for "i" (aka keys referencing strings and not functions) would be returned. Please correct this line.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

Status: Active » Needs review
FileSize
578 bytes

Here's an actual patch to fix this, sorry for not submitting it originally.

samuel.mortenson’s picture

I noticed that two people have re-queued this patch for testing - anyone care to RTBC?

Nitebreed’s picture

Hmm I also use Panels IPE, but I'm not running into this error (using the latest dev version of panels though)

I have the feeling the code causing the error may already have been fixed (you still use 7.x-3.3?)

What are the steps to reproduce this error?

samuel.mortenson’s picture

Unfortunately at the time I submitted the issue I was working with a client who I no longer have access to, so I'm not able to replicate the error. I assume that others have used this patch as there are 6 watchers, so if they could chime in that would help push this along. :)

leahtard’s picture

Thank you for this fix @samuel.mortenson. I just ran into the same error with Mini Panels IPE.

Before this patch, I would click on "Customize this page" and there would be no popup. I do have other Mini Panels that were working correctly. There were a few specialized factors associated with the problematic Mini Panel:

- All of my mini panels were views that were listing a particular Display Suite view mode. So not a field based view.
- My problematic Mini Panel was displaying an Image that had a custom formatter. This formatter has some JS included. I assume this was casing some sort of conflict.

I am happy to provide more details if needed.

Cheers, Leah

samuel.mortenson’s picture

@leahtard Care to mark the issue as RTBC? If the patch is working for you and makes sense, of course.

dan.munn’s picture

@samuel.mortenson closing this as a duplicate of issue #2161223 which was raised 3 months prior to your bug; the original proposed patch there contains the same fix, but also fixes other for loops that are likely to suffer the same problem.