Collapsible text works only ONCE

rolf - May 8, 2008 - 20:54
Project:Collapsible Text
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:pukku
Status:closed
Description

Hi
I urgently need collapsible text in our intranet (Drupal 5.7 with CCK and Views), but I experienced the following effect:
- Installation of Module, config of filter - everything ok and the collapsible text works.

BUT if I quit the actual page with collapsible text built in and come back to the page it does not work at all.

What I did to figure out the reason;

- Disabled all other filters
- Tried another Theme
- Disabled all modules which seem to bring in javascript conflicts
- Checked the forum

But still the same effect.

Any idea what the reason could be?

Thanks for a quick hint.

Cheers, Rolf

#1

jippie1948 - June 2, 2008 - 23:53

I have the same problem.

Collapse works when I resubmit the 'HTML input filter' page or rearrange the filters.

When I next refresh the page with [collapse collapsed] etc. its decollapse functionality disappears, but the text stays collapsed.

The following two lines are part of the working page source and are missing in the not-working page:

<script type="text/javascript" src="/misc/collapse.js"></script>
<script type="text/javascript" src="/modules/contrib/jstools/collapse.js"></script>

What can I do to prevent the above lines of being written out when there is a page refresh?

Thanks,

JanPieter.

#2

rivena - June 5, 2008 - 06:24

I have the same or similar problem. On any given page with collapsible text on it, it starts open, I can close it and open it, but then it won't close again. It happens on any browser I have, IE and Netscape. My admin has also reported this on Firefox.

I've noticed that I have the same problem with the options on the bottom of the page, irrespective of what option it is.

Update: My problem was fixed when I copied the jquery.js file from the /modules/jquery_update/ to misc/.

Anisa.

#3

chapo - June 29, 2008 - 22:40

I also have the same problem. I tried to install jquery update files in /misc but it still doesn't work.
Does anyone found the clue of this strange behaviour ?
Thanking you for your help and advises

Pierre

#4

jippie1948 - September 3, 2008 - 23:03

Hi there,

eventually I found the solution of the problem myself in issue http://drupal.org/node/256354

I added the following function to collapse_text.module


function collapse_text_init() {
drupal_add_js('misc/collapse.js', 'core', 'header', FALSE, TRUE);
}

Everything works now fine!

All the best,

JanPieter.

#5

pukku - December 15, 2008 - 15:20
Version:5.x-1.0» 6.x-1.0
Assigned to:Anonymous» pukku
Status:active» needs review

Hi! This turns out to be a caching issue. The solution above (implementing hook_init()) is the best solution that I know of right now, although it's not really the correct solution (I'm not sure that Drupal allows us to provide the best solution).

I've attached a patch.

AttachmentSize
collapse_text_init_patch.txt 1.25 KB

#6

pukku - December 15, 2008 - 15:21
Status:needs review» fixed

Commited.

#7

System Message - December 29, 2008 - 15:22
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.