(Fixed in beta 5)

Updated to 7.x-1.1-beta4 using normal Drupal admin menus. Site immediately white-screened. Tried to disable spamspan using drush, but got:

Drush command terminated abnormally due to an unrecoverable error.                                           [error]
Error: syntax error, unexpected T_FUNCTION in
...sites/all/modules/spamspan-dis/spamspan.module, line 138

Didn't spend time to diagnose, just restored backup spamspan directory and all works again. Not sure why others don't have this problem--maybe lost a bit during download?

Comments

grahamshepherd’s picture

I experienced the same problem. Upgrading to beta4 crashed my whole site with the same error reported above.

StephanP’s picture

Same here.
Had to completely remove the SpamSpan folder to recover.

jdanthinne’s picture

Same here with servers running PHP<5.3, but ok with PHP>5.3.
Must be the use of the use keyword in the function call (lines 138 and 142) that is not supported.

grahamshepherd’s picture

I am using PHP 5.3.28 and still have the problem.

porf’s picture

Same issue.
Upgraded via Admin menu, whole site down with same error message (line 138).
Had to disable module in the database to get site back.
Had to reload SpamSpan folder from backup to get module working again.
PHP Version = 5.2.17

roball’s picture

Title: complete crash - beta 4 » WSOD with 7.x-1.1-beta4

I did NOT observe any problems with SpamSpan filter 7.x-1.1-beta4 on a CentOS 6 server (PHP 5.3.3).

peterx’s picture

Status: Active » Closed (fixed)

This looks like a Drush/Drupal error. Beta 3 and 4 did nothing to crash anything. Beta 2 introduced a class mentioned in the .info file and removed an unused file reference hanging round in beta 1.

Some people had problems updating from beta 1 to beta 2:https://www.drupal.org/node/2365463
The easiest solution was to disable the module, replace the code, then enable the module.

You should be able to replace the code and run update.php but Drupal sometimes fails with mystery messages when file references are changed in the .info file. Drupal appears to try to load the module files mentioned in the old .info before checking the modules for updates. The disable/replace/enable sequence appears to be the only way to make Drupal work reliably.

Drush should generate, in code, the disable/replace/enable sequence to force the correct refresh from the .info file.

If Drupal is not fixed, the module developers could never remove file references from .info.

StephanP’s picture

Well, you may think nothing has changed between these two versions, but the fact remains that it crashes.
Also after updating Drupal Core to 7.33, this beta4 of SpamSpan crashes the site.
I had to revert to beta3 to get things working again.

Further information:
beta4 functions fine with a D7.33 site on PHP 5.3.23
beta4 does have an issue with a D7.33 site on PHP 5.2.17

peterx’s picture

@Stephan, all my sites are on 5.5 or later. Can you test on 5.2?

Beta 4 contains anonymous functions. Anonymous functions were introduced in PHP 5.3, the version recommended for Drupal 7. Anonymous functions appeared as code errors in 5.2 way back when they were first introduced and I still had sites on 5.2.

Drupal suppresses PHP errors then continues processing and crashes in weird places. This is one of the painful bits of Drupal, there is no option to start a site as "test".

All my test sites have all error reporting turned on plus some have mods to Drupal commenting out the spots where Drupal suppresses errors. Back when I was converting from 5.2 to 5.3, PHP reported syntax errors for 5.3 code used in 5.2.

Some Drupal add-on modules have PHP version checks in the .info file or the enable() function. I will look at adding a version check or reverting to old style code. Either way, can you run a test on 5.2?

This will have to wait a day, the sun is shining and the surf is up.

grahamshepherd’s picture

Status: Closed (fixed) » Active

I have reopened this issue. It is not fixed.

With Drupal 7.33 and PHP 5.3 my sites still crash with beta4.

Fatal error: Invalid opcode 153/1/8. in /home/mysite/public_html/sites/all/modules/spamspan/spamspan.module on line 138

Only restored by restoring beta3 folder.

jdanthinne’s picture

Although PHP 5.3 is recommend for D7, PHP 5.2.5 is listed as requirement, so I think every module should be compatible with this lower version.

StephanP’s picture

@Peter, I only have these two installations on hosted environments for which I have limited access rights.
If you'd like me test before release, then I can be of help.
I will not be of much help in terms of debugging PHP-code or server administrative stuff.
World clock benefits/disadvantages: I'm in Amsterdam (Central European Timezone)

peterx’s picture

Version: 7.x-1.1-beta4 » 7.x-1.1-beta5
Status: Active » Reviewed & tested by the community

Beta 5 removes the anonymous functions. Tested with PHP 5.5 at http://petermoulding.com/spamspan. Needs testing with PHP 5.2.

StephanP’s picture

Tested with a D7.33 site on PHP 5.3.23 AND with a D7.33 site on PHP 5.2.17.
All seems fine now.

peterx’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (fixed)