Closed (outdated)
Project:
CAPTCHA
Version:
7.x-1.0-alpha2
Component:
Miscellaneous
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2011 at 10:52 UTC
Updated:
4 Oct 2018 at 12:10 UTC
Jump to comment: Most recent
Comments
Comment #1
dedisoft commentedIf I uninstall the module, and then reinstall it, all is ok.
I've never installed the version 7.x-1.0-alpha1 (I've seen http://drupal.org/node/1011154 before reporting the issue).
Comment #2
maggros commentedHi -
I just applied this update and now we are getting the following error:
user warning: Unknown column 'token' in 'field list' query: UPDATE captcha_sessions SET token='1b06b191b75c538c0ec44b10977ab34c' WHERE csid=18292 in /home/jill/web/sites/all/modules/captcha/captcha.module on line 213.
What didn't I do?
TIA
maggros
Comment #3
soxofaan commented@maggros: did you run the update.php (example.com/update.php) script?
Comment #4
soxofaan commented@dedisoft (the original problem of this thread)
Ouch, this is nasty problem: the update code is
which was written for Drupal 6. However, in Drupal 7, the db_change_field function changed its argument list (also see http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/d...):
This means that the original update function
captcha_update_6203should be run on a Drupal 6 setup before upgrading to a Drupal 7 setup.Possible solutions:
* make a 6.x-2.4 release and document that users should first update to 6.x-2.4 before upgrading to Drupal 7
* change the upgrade function
captcha_update_6203: detect if we are running on a D7 setup and call thedb_change_fieldfunction accordingly.Comment #5
soxofaan commentedFYI: I changed the upgrade note on the release notes of CAPTCHA 7.x-1.0-alpha2 to indicate that upgrade from D6 doesn't work currently.
Comment #6
soxofaan commentedrelated issue: #1040324: Install / Update Modules results in AJAX HTTP error do to db_add_column() call
Comment #7
soxofaan commentedI just released CAPTCHA 6.x-2.4 and updated the upgrade info for 7.x-1.0-alpha2 that it is required to first upgrade to 6.x-2.4 before upgrading to 7.x-1.x. This seems to be standard upgrade procedure. Tweaking/porting the hook_update_N functions apparently is not recommended.
Also, I learned on IRC that with hook_update_last_removed, one can force to first upgrade to a certain D6 version before upgrading to a D7 version: in the D7 version of captcha.install, remove all D6 upgrade functions and implement hook_update_last_removed, returning the number of the last D6 update function. If the user did not upgrade to the latest D6 version first, he won't be able to upgrade to D7.
I have to look into this a bit more.
Comment #8
soxofaan commentedComment #9
xurizaemonFor congenitally lazy users of MySQL.
Comment #10
steinmb commented