I have a bunch of embeded collapsible blocks within a main block, and then within each of those blocks is a table that I create using a theme function. Here is the themeing function that creates the tables (I have removed all of the ugly details to make it easier to read).

function theme_school_course_form($form) {
  $output = '';
  $header = array(...//the needed headers here);
  foreach (element_children($form['sections']) as $key) {
    $rows = array();
    foreach(element_children($form['sections'][$key]) as $key2) {
      $row = array();
      $row['data'][] = drupal_render($form['sections'][$key][$key2]['cat1']);
      $row['data'][] = drupal_render($form['sections'][$key][$key2]['title']);
      $rows[] = $row;
    }
    $form['sections'][$key]['table'] = array(
      '#type' => 'markup',
      '#value' =>theme('table', $header, $rows)
    );
  }
  $output.= drupal_render($form);
  return $output;
}

This creates the tables inside the dropdowns and it looks great in the browsers as mentioned. However, in IE7 the tables do not show up when you expand collapsed fieldsets. If you look at the source, all of the source is there for the tables and all of the information is there, but expanding them doesn't do anything (it is just an empty fieldset). This is assuming the fieldsets are collapsed to start. However, if the fieldsets are not collapsed as default, then the tables show up fine and I can collapse and uncollapse them fine and everything works great.

In review, there is an error with the rendering of tables that are themed into collapsibled fieldsets that are defautled as collapsed in IE7. In IE6 and Firefox, they work fine.

Comments

Anonymous’s picture

I have noticed the same behavior.
The weird thing is that everything works fine in IE 7.0.5730.11 but the table is not shown in IE 7.0.5730.13
Obviously something has changed between these two versions of IE 7.

If we could figure out what triggers the issue in IE, we might be able to find a workaround.

drumm’s picture

Title: IE7 error with tables in collapsed fieldsets » IE7 does not show tables in collapsed fieldsets
Version: 5.6 » 7.x-dev

This is probably an issue with all versions of Drupal.

gunzip’s picture

subscribe

Tim Cullen’s picture

As the original poster noted, if the fieldset is expanded by default, the toggle mechanism works. I've used this as a workaround:

$form = array(
  '#title' => t('Fieldset Title'),
  '#collapsible' => TRUE,
  '#collapsed' => (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 7.0') !== FALSE) ? FALSE : TRUE,  // default to expanded for IE7
  '#type' => 'fieldset',
  '#attributes' => array('id' => 'fieldset_unique_id'),  // let's make it easy for jquery to find our fieldset
);

if (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 7.0') !== FALSE) {
  // collapse the fieldset when the page is ready and the toggle works.
  $js_code = "
    if (Drupal.jsEnabled) {
      $(document).ready(function() {
        $('#fieldset_unique_id').addClass('collapsed');
      });
    };
  ";
  drupal_add_js($js_code,'inline','footer');
}
rkdesantos’s picture

This problem is plaguing some of my users. We have a Drupal v5.14 setup. Any patch or workaround until this bug can big fixed would be appreciated as it renders the ability to post to Drupal for IE7 impossible if any default settings in a non-working fieldset require changes.

(The suggested workaround in #4 is impractical as it would, as I understand it, require patching every module that creates a collapsed fieldset. If there is a way to fix this by changing only one or two files I don't get that from the the post.)

jdipper’s picture

It looks like IE7 is somewhat going backwards...

In the system.css there are a few specific lines for IE6 (using * html):

/* Note: IE-only fix due to '* html' (breaks Konqueror otherwise). */
*html.js fieldset.collapsed legend,
*html.js fieldset.collapsed legend *,
*html.js fieldset.collapsed table * {
display: inline;
}

The symptom here is that tables aren't being displayed when coming from collapsed to open. Adding this fixes it:

html.js fieldset.collapsed table * {
display: inline;
}

Of course, the system.css states that this will break Konqueror, and core doesn't have an IE7 style sheet (although themes do), so I am unsure of where it could go.

Hopefully this will help people who are in need of a quick fix and also help to find a permanent solution! :-)

Jack

rkdesantos’s picture

Thanks, jdipper. I tried this on v5.15 but it did not seem to have any effect. Logging in on my system as one of the users the collapsed fieldsets were still collapsed and could not be opened.

jdipper’s picture

Yeah, should have said that I was using 6.9 :-\

I do think, however, that it's a related issue; seems IE's having issues with assigning styles when classes are assigned by JS (although I have no idea why it's only affecting tables).

Do you have access to IE6 and see if it works on that? If it does, it might be worth finding out if any *html entries can be used (as IE7 doesn't use them, you'll have to unstar them to test it out).

Failing that I'll take a peak this weekend to see if I can spot why IE7 isn't playing ball with D5.

Jack

rkdesantos’s picture

I don't have access to IE6 but I have IE7. I tried it with IE7 and unstarred the entries. Fieldsets still collapsed.

misty3’s picture

subscribed

Dave Reid’s picture

Issue tags: +JavaScript, +ie7
deviantintegral’s picture

Subscribing. This affects my Term Permissions module. The suggested hack in #4 works fine for me, though obviously isn't a long-term solution.

Frank Steiner’s picture

Solution from #7 works fine at our site for IE7 and Drupal 6.9.

Jztinfinity’s picture

This could be the issue: http://cssbeauty.com/skillshare/discussion/1515/fieldset-woe-in-safari-ie7/ , a drupalized way to solve that would be in fieldsets with tables, use #prefix => div for the first element, #suffix => div for the last element, or to do things more properly, tweak the redering process.

sun.core’s picture

Priority: Critical » Normal

Whatever IE is... it's definitely not a cause for us to treat this as critical.

rkdesantos’s picture

This is a usability issue not just an IE issue. If users cannot access the features of Drupal that seems to me to be fairly important.

rkdesantos’s picture

This is a usability issue not just an IE issue. If users cannot access the features of Drupal and post that seems to me to be fairly important.

916Designs’s picture

Note to future cross browser battlers:

Fusion sub theme, ubercart checkout page, Terms of Service Ubercart Module, IE7, Internet Explorer 7 CSS Problems.

To cure the inline table on payment details, I had to resort to:

#payment_details div   {
	height: 200px;
}
#payment_details div div {
	height: auto;
}

I gave up on a scrolling terms of service node. The node is embedded, and fusion has too much (in this case) style hooked up to the 3 or so containing divs:

.tos-text {
	height: auto; /* epic fail.. give up on usability */	
}

But at least it aint IE6 anymore!

djac’s picture

Subscribe

Lucasljj’s picture

Drupal 7 require Internet Explorer 8.x and later, see https://www.drupal.org/node/61509 :)

Lucasljj’s picture

Status: Active » Closed (won't fix)
David_Rothstein’s picture

Priority: Normal » Minor
Status: Closed (won't fix) » Active

That page was misleading (and looks like it since has been fixed). We haven't officially dropped support for IE7 in Drupal 7. Certainly these issues are very low priority now, but if someone wants to fix them and can do it in a way that doesn't hurt other browsers, it's still possible to do so.