When I use the Rubik admin theme, the substitutions fieldset is acting very strange.

First it shows all the data inside of it, then I have to click twise do get it to collapse.

I think that this is because its a hard coded fieldset in the #prefix.

// We have to create a manual fieldset because fieldsets do not support IDs.
      // Use 'hidden' instead of 'markup' so that the process will run.
      // Add js for collapsible fieldsets manually
      drupal_add_js('misc/collapse.js');
      $form['display_title']['contexts_prefix'] = array(
        '#type' => 'hidden',
        '#id' => 'edit-display-substitutions',
        '#prefix' => '<div><fieldset id="edit-display-substitutions" class="collapsed collapsible"><legend>' . t('Substitutions') . '</legend>',
        '#process' => array('ctools_dependent_process'),
        '#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)),
      );

The comment says We have to create a manual fieldset because fieldsets do not support IDs.
And as far as I can see, thats not true.
You can specify #attributes with "ID" => "edit-display-substitutions".

My suggestion is this.

Make an array that contains the fieldset

$display_fieldset = array(
        '#title' => t('Substitutions'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#attributes' => array('id' => 'edit-display-substitutions'),
        '#children' => theme('table', $header, $rows),
      );

And run this thru theme_fieldset

Also, no sure why the type for $form['display_title']['contexts_prefix'] is "hidden"

CommentFileSizeAuthor
display-edit.inc_.patch2.27 KBanon

Comments

anon’s picture

Status: Active » Needs review
freakalis’s picture

Status: Needs review » Reviewed & tested by the community

Patch working for me.

Letharion’s picture

Title: "Substitutions" fieldset dosent behave like it should do » "Substitutions" fieldset does not behave like it should.
Version: 6.x-3.8 » 6.x-3.10
Status: Reviewed & tested by the community » Closed (won't fix)

Problem still exists with D6.22 and P3.10. Patch solves the problem. This is not an issue in D7.
@Anon, any particular reason you remove the Javascript?
If re-adding it was without problems, I wouldn't hesitate to recommend this be commited.

Now however, if we add the JS, then the substitutions box loses it's background, and the + link to the left slides down to far, so the whole thing looks a bit wierd. There is also an issue over here #960642: "Substitutions" collapsible fieldset not initially collapsed in panels, rules, VBO admin which shows that this isn't a Panels specific problem, but exists in several modules, and may be caused by Rubik instead.

Since this is quite old, minor, and possible not because of any fault to Panels, I'm closing this one "Won't fix", if only to see if that upsets someone who feels this should be commited.