I found a bug using cck fieldgroup tabs when rendering fielgroups from path_redirect.
The path_redirect adds a fieldset with links to the path_redirect add form with the configuration in variables.

The tabs.js selector ('.drupal-tabs ul').children('li').each() finds any li tag inside the drupal-tabs, and even the path_redirect ul li from the links into the fieldset,
the next selector $($(this).find('a').attr('href')) creates this exception breaking the tabs:

uncaught exception: Syntax error, unrecognized expression: /admin/build/path-redirect/add?destination=node%2F264%2Fedit&redirect=node%2F264&language=

In order to avoid the selector searching nested li's I propose changin the selector from
$('.drupal-tabs ul').children('li').each( to $('.drupal-tabs').children('ul > li').each(
this way only search for the first ul->li pairs and not any other ul->li structure into the tab

CommentFileSizeAuthor
tabs_js_selector.patch538 bytesjcmarco
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

Status: Needs review » Fixed

Thanks, makes sense, committed.

Status: Fixed » Closed (fixed)

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

Moonshine’s picture

Status: Closed (fixed) » Needs review

I know I'm really late to the party here, but I finally updated tabs using the latest dev and this change seems to create some very odd css error assignments for me. It's weird that I would be the only one, so I'm tentative about re-opening the issue, but I will in case someone else can take a peek. If the goal was just to change the code such that only the first UL element (with the "tabs") is picked up, then the following seems appropriate and works fine for me:

  // Set the active class to the first tab with an form error.
  $('.drupal-tabs ul:first').children('li').each( function() {
    if ($($(this).find('a').attr('href')).find('div.form-item .error:first').size()) {
      $(this).addClass('error').addClass('ui-tabs-selected');
    }
  });

I think this would be the right approach, but will defer to the jquery masters. :)