When you place something in the hook_onload, it causes collapsible form groups to not be collapsible.

Comments

Souvent22’s picture

Status: Active » Closed (fixed)

I had a div in which i changed the name of it's id, and that fixed the problem. pehraps there is some documentation somewhere about reserved words/ids that a used in the core js? Anyway, fixed. :). don't know if it's a bug or not really though.

darius’s picture

Title: When you make an onLoad event, collabsible from groups are not collabsipbe » When you make an onLoad event, collapsible forms become not collapsible
Component: module system » base system
Status: Closed (fixed) » Active

This seems to be a bug. Any use of hook_onload stops collapse.js functions from being loaded. See also http://drupal.org/node/28700.

Darius

dblado’s picture

Hi Darius,

Took me a while to track down this post :) :) was pulling my hair out becuase when I disabled my module, the collapsible forms came back :)
haha

I'm still seeing this issue and I don't have context links installed..I did a little test and commented out my onload hook and the collapsible forms work fine...

any ideas? even if I hardcode my onload into my theme, I get the same behavior!??!

m3avrck’s picture

Category: bug » support

This isn't a bug with Drupal, but rather the module itself. It cannot explicity declare an onLoad() handler, otherwise it'll override the other ones on the pager (e.g., collapsible fieldsets).

To get around this, use the Drupal-specific function: addLoadEvent()

m3avrck’s picture

Category: support » bug

Hmm, I might have mis read the first post, are you using hook_onload() to add an event? This shouldn't cause this behavior but I don't have time to look into this anymore at the moment.

dblado’s picture

I did change it to addLoadEvent in js and that worked...however, hook_onload should either be fixed or removed...

who is responsible for that?? We should try and get that done for the 4.7 release!

darius’s picture

Status: Active » Closed (duplicate)

There is another thread that duplicated this issue: http://drupal.org/node/27884
I am closing this one then. It seems that hook_onload will be removed.

Darius