Installed on Drupal 7.5

Comments

Nikdilis’s picture

Title: Received a WSOD with the error: Fatal error: Class 'Database' not found in collapse_text.module on line 605 » Received a WSOD with the error: Fatal error: Class 'Database' not found in collapse_text.module on line 605 after installation
pukku’s picture

Please try the 7.x-2.x-dev version. The error you are reporting happens when the module is looking at the entire page to determine if it needs to add the collapsing library, and is not actually a bug in collapse_text. But the dev version changes how this code works a bit, which might fix the problem.

Ricky

Nikdilis’s picture

Status: Active » Closed (fixed)

[Hi Ricky, the 7.x-2.x-dev version worked. Thank you.]

Edit: First it worked, but finally the error shows up again.

Nikdilis’s picture

Status: Closed (fixed) » Fixed
Nikdilis’s picture

Status: Fixed » Active
Nikdilis’s picture

Status: Active » Closed (fixed)

My mistake. Getting too tired. Didn't use the 7.x-2.x-dev on the drupal installation where the error occured...
Now confirming again... 7.x-2.x-dev version works.
Closing this issue and going to sleep! ;-)

pukku’s picture

Status: Closed (fixed) » Active

Hm. Presuming the error is now thrown at line 613 (if still at 605, then something has cached an old version of the code), the issue is that while the array walks through the $page variable, it's coming across some kind of object that is broken. I don't believe this is actually a problem with the collapse_text module, but rather some other module that has an error that is only coming to light because I'm walking through the entire page tree.

You could try installing the devel module, and then changing the code at line 612 from

  try {
    array_walk_recursive($variables['page'], '_collapse_text_preprocess_page_walk_callback');
  }

to

  try {
    dpm($variables['page']);
  }

This will then print out the page variable, allowing you to look into it and see what is breaking things.

While the code is changed this way, collapsing text won't work, because it will never add the appropriate javascript library.

Ricky

Nikdilis’s picture

Status: Active » Closed (fixed)

Hi Ricky, thanks again for your help. See #6 - 7.x-2.x-dev version works.
Closing this issue.