Download & Extend

Panels ipe js error in firefox

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

Issue Summary

Getting this error when trying to move content panes and moving is not possible in firefox 9.0.1
Works in chrome though.

Error: $pane.attr("id") is undefined
Source File: http://localhost/drupal7.9/sites/all/modules/contrib/panels/panels_ipe/j...
Line: 80

Comments

#1

Correction. It is not working in Chrome either.

#2

Title:Panels ipe js in firefox» Panels ipe js error in firefox

#3

ok.I added a condition to check whether 'id' attribute is there or not before replacing it with empty string.
and it works now in chrome and firefox. I don't if there is any side effect to this or not.

    if($pane.attr('id')){
      var paneId = $pane.attr('id').replace('panels-ipe-paneid-', '');

      var disabledRegions = false;

      // Determined if this pane is locked out of this region.
      if (!Drupal.settings.Panels.RegionLock[paneId] || Drupal.settings.Panels.RegionLock[paneId][region]) {
        ipe.sortables[region].sortable('enable');
        ipe.sortables[region].sortable('refresh');
      }
      else {
        disabledRegions = true;
        ipe.sortables[region].sortable('disable');
        ipe.sortables[region].sortable('refresh');
      }

      // If we disabled regions, we need to
      if (disabledRegions) {
        $(event.srcElement).bind('dragstop', function(event, ui) {
        // Go through
        });
      }
    }

#4

Can you attach that as a patch?

#5

I will try.
Just started working in php/drupal/git.
I am no where near that level yet.

#6

#7

What's interesting is that it shouldn't be possible for this to happen. It seems to indicate that after finding a pane, it can't find the class containing the pane's id. While your fix may be a decent workaround it might be obscuring some bigger error. Or it might be something minor. I can't tell without being able to reproduce this situation, I think.

#8

Status:active» needs review

#9

Why is the above patch file link gives 404?

AttachmentSize
panels-panels-ipe-js-firefox-bug-1417762.patch 1.8 KB

#10

There's a # in the filename and the URL isn't being properly encoded. I was able to get to the actual patch file replacing it with %23 manually.

#11

Try this patch instead; it's a little cleaner and I think has the same effect.

AttachmentSize
1417762-fix-ipe-locks.patch 624 bytes

#12

Yes.It works.
Thanks.
Were you able to reproduce the issue?

#13

No but I didn't try very hard, either. I'm willing to commit this because it's pretty easy.

#14

That's fine. I am ok with you committing this fix.

#15

Status:needs review» active

We stumbled up on another thing. We don't know whether it is a bug or it is supposed to work that way.

We have a front page panel page. One of our user using the customize this page option, moved a content pane.
Saved it. Again using customize this page option, deleted one of the content pane and saved it.
Refreshed the page and now all the content panes on the front page are gone.

Initially the panel page storage is 'In Code'.
After all the panes are gone, i went to Admin/structure/pages page and saw the storage is now Overridden.
I am able to revert to the previous state of the page using the revert option and again now the storage is 'In Code'.

If we do move pane, save and refresh the page. Then delete a content pane, save and refresh the page, everything is fine.

#16

In the patches #9 or #11, the behaviors in L81-91 of panels_ipe.js is always ignored with firefox.
This is not the same behavior with the other browsers.

The pane id should be obtained not from event but from ui.item.

- var $pane = $(event.srcElement).parents('.panels-ipe-portlet-wrapper');
- var paneId = $pane.attr('id').replace('panels-ipe-paneid-', '');

+ var paneId = ui.item.attr('id').replace('panels-ipe-paneid-', '');



(By the way, event.srcElement is not set in firefox, we should use event.target for the cross-browser behavier.)
AttachmentSize
Panels_ipe_js_error_in_firefox-1417762-15.patch 836 bytes

#17

Status:active» needs review

Sorry, please review the above patch code.

#18

Status:needs review» fixed

This seems to work!

#19

Status:fixed» closed (fixed)

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

nobody click here