backdrop-contrib / spambot

Anti-spam module that uses data from www.stopforumspam.com to protect the user registration form against known spammers and spambots.
GNU General Public License v2.0
0 stars 2 forks source link

Upgrade path from Drupal 7 #6

Open jenlampton opened 1 week ago

jenlampton commented 1 week ago

When upgrading from Drupal 7 I get the following error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: site/core/update.php?op=selection&token=i7Jv_S40J12XDDm-JGLLNpvcM9W0KxoLT8GKappCybU&id=68417&op=do_nojs&op=do StatusText: error ResponseText: Error: Undefined constant "SPAMBOT_DEFAULT_CRITERIA_EMAIL" in spambot_update_1000() (line 56 of /var/www/html/docroot/modules/contrib/spambot/spambot.install).

There are a lot of constants being used in the update hook that are defined in the .module file, and this file is not present during updates. The recommend approach is to use the defined values in the update, rather than the constants.

PR on the way.

jenlampton commented 1 week ago

I also just noticed that my Drupal site did not have the cache_spambot table, so I'm adding an implementation of hook_update_last_removed() to this PR, just to make sure everyone (ahem, me!) is on the proper version before upgrading.

On second thought... that update was only included in the -dev version of spambot for Drupal. So instead of requiring that people update from the latest stable version to -dev before moving to Backdrop, I'm just going to duplicate that update into the upgrade path to Backdrop.