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

dhina’s picture

Correction. It is not working in Chrome either.

dhina’s picture

Title: Panels ipe js in firefox » Panels ipe js error in firefox
dhina’s picture

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
        });
      }
    }
Letharion’s picture

Can you attach that as a patch?

dhina’s picture

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

dhina’s picture

merlinofchaos’s picture

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.

dhina’s picture

Status: Active » Needs review
dhina’s picture

Why is the above patch file link gives 404?

merlinofchaos’s picture

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.

merlinofchaos’s picture

StatusFileSize
new624 bytes

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

dhina’s picture

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

merlinofchaos’s picture

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

dhina’s picture

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

dhina’s picture

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.

haiiro.shimeji’s picture

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

haiiro.shimeji’s picture

Status: Active » Needs review

Sorry, please review the above patch code.

merlinofchaos’s picture

Status: Needs review » Fixed

This seems to work!

Status: Fixed » Closed (fixed)

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

  • Commit 18e900a on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1417762 by  haiiro.shimeji: Fix pane id acquisition to properly...