Closed (fixed)
Project:
Spam
Version:
5.x-3.0-alpha5
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 May 2008 at 21:18 UTC
Updated:
14 Jun 2008 at 19:11 UTC
Jump to comment: Most recent
After spam.module gets activated, every Drupal pages return an empty string (both the admin pages and the nodes).
Comments
Comment #1
avpadernoThat is also valid for the version 5.x-3.x-dev.
Comment #2
jeremy commentedI'm using the 3.0 spam module on several websites without problems, including KernelTrap.org -- I'd like to understand what's different about your system. What version of Drupal are you using? What OS? MySQL or PostgreSQL? What version of PHP are you using?
Do you see any errors in Drupal's watchdog logs or in Apache's error_log?
Comment #3
avpadernoI confirm it. Whenever I install it, Drupal doesn't work anymore, and I am not even able to see the modules administration page.
This is the info about the Drupal installation:
Drupal 5.8-dev
Configuration file Protected
Cron maintenance tasks Last run 7 hours 43 min ago
Database schema Up to date
File system Writable (public download method)
GD library bundled (2.0.28 compatible)
JQuery Update Installed correctly
The current installed version of JQuery is 1.2.3
MySQL database 4.1.22
PHP 4.4.6
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server
The web server is not listed by Drupal but it is a Linux i686.
I will check for any errors in the Drupal log, but at the moment I have to understand which ones come after I activate the module, and which ones come after I delete the module files (that is the only way to have Drupal working again).
Comment #4
avpadernoThe error I get when I activate the Spam API module (yes, that is enough to cause the "boom") is something like this:
That is repeated everytime it tries to rename a table from XXX to old_XXX. I guess the
hook_update_N()tries to update the module even if there are not any previous installed versions.Comment #5
avpadernoThe only function that tries to rename tables is
spam_upgrade_0(). That function is actually called fromspam_install(), which is not supposed to be called when the module is being updated, but when the module is being installed for the first time.If you want to update from previous versions, in Drupal 5.x you can simply add a function like
spam_update_1(), as Drupal 5.x numbers the updates sequentially starting with 1 (see Drupal API).In detail, Drupal 5.x executes the update function whose number is the first number higher than the number it finds in the
{system}table (which is 0 in the case Drupal didn't execute any updates for that module).Things change from Drupal 6.x, as reported in the Drupal API changes page.
Comment #6
avpadernoI tried to create a patch for
spam.installbut the code is almost completely wrong.This is because:
spam_install()should not be called fromspam_update_5300();hook_update_N()is supposed to callupdate_sql()for every change to the database, whilehook_install()should calldb_query()._spam_upgrade_in_progress()should be deleted.Comment #7
jeremy commentedThe call to spam_install() from _update_5300 was supposed to be a call to spam_upgrade_0(), not sure how that slipped through. Anyway, thanks for reporting it, fixed in the latest development version.