Fieldset title does not include text enclosed in tags when collapsed

hass - April 30, 2007 - 10:10
Project:Drupal
Version:7.x-dev
Component:system.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

if the fieldset contains an EM - all between <em></em> is not displayed.

<fieldset class=" collapsible collapsed"><legend>Modules in <em>modules</em></legend>

#1

edmund.kwok - May 3, 2007 - 12:58
Title:fieldset legend incomplete» Fieldset title does not include text enclosed in tags when collapsed
Component:Garland theme» system.module

Managed to replicate this bug in 5.1 and with a contributed theme (glossyblue), tested on Firefox 2, Mac. When the fieldset is expanded, the title is displayed as usual, but when collapsed, text enclosed in tags (e.g. em, strong) are hidden. Changed title to reflect the issue better. See the attached screenshot for an example.

I traced it to a css declaration in the system.css file around line 309:

html.js fieldset.collapsed * {
  display: none;
}

Removing that seems to fix the problem and I don't see other repercussions. But I am no expert in css and not sure if it serves another purpose. Comments from css experts?

AttachmentSizeStatusTest resultOperations
Fieldset title display bug #140253.png10.74 KBIgnoredNoneNone

#2

Steven - May 3, 2007 - 23:22

Removing that line will cause fieldsets to snap shut after the DOM completes loading. This wouldn't be noticable if you're only testing locally. Better patch needed.

#3

ricabrantes - March 13, 2008 - 15:49

Any news???

#4

beginner - April 29, 2008 - 08:28
Version:5.1» 7.x-dev

The bug is still present.
It was also reported here:
http://drupal.org/node/251292
I had to change the form definition from:

<?php
  $form
[$role] = array(
   
'#type' => 'fieldset',
   
'#collapsible' => true,
   
'#collapsed' => true,
   
'#title' => t('Front Page for %rolename.', array('%rolename' => $rolename)),
  );
?>

to
<?php
   
  $form
[$role] = array(
   
'#type' => 'fieldset',
   
'#collapsible' => true,
   
'#collapsed' => true,
   
'#title' => t('Front Page for !rolename.', array('!rolename' => $rolename)), // % becomes !
 
);
?>

#5

edmund.kwok - April 29, 2008 - 09:41
Status:active» needs review

Attached patch seems to fix this issue in Safari 3.1 (Mac), Firefox 2.0.0.8 (Mac) and IE6 (Mac). Need more testing to verify though; not sure if there are any side effects.

AttachmentSizeStatusTest resultOperations
fieldset_html_in_title.patch626 bytesIdleFailed: 7589 passes, 46 fails, 514 exceptionsView details | Re-test

#6

Dublin Drupaller - April 29, 2008 - 17:00
Assigned to:Anonymous» Dublin Drupaller

thanks for the patch edkwh...I'll test it later. Looks good.

Dub

#7

Dublin Drupaller - April 29, 2008 - 17:02
Assigned to:Dublin Drupaller» Anonymous

oops. wrong module. I don't have permissions to commit to the system.module. changing assigned to status

#9

hass - April 29, 2008 - 17:05

As i remember from a Garland bug regarding this issue the above patch have side effects... try to search for a "garland legend" issue...

#10

Arancaytar - November 14, 2008 - 16:02

As a warning, * affects tags that would not normally be displayed - not that the legend is likely to contain a script or a style tag, of course.

#11

System Message - November 16, 2008 - 21:40
Status:needs review» needs work

The last submitted patch failed testing.

#12

lilou - November 17, 2008 - 13:28

#13

System Message - December 16, 2008 - 12:15
Status:needs review» needs work

The last submitted patch failed testing.

 
 

Drupal is a registered trademark of Dries Buytaert.