When running update.php on updating to 6.x-5.1 I get the following errors on update.php?op=results
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/www/www.mywebsite.com/update.php on line 173.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/www/www.mywebsite.com/update.php on line 173.
user warning: Unknown column 'added_by_uid' in 'twitter_account' query: ALTER TABLE twitter_account CHANGE `added_by_uid` `uid` INT unsigned NOT NULL DEFAULT 0 in /home/www/www.mywebsite.com/includes/database.mysql-common.inc on line 529.
The selected file /tmp/filehVnyRA could not be uploaded, because the destination sites/default/files/js/gmap_markers.js is not properly configured.
warning: Invalid argument supplied for foreach() in /home/www/www.mywebsite.com/update.php on line 340.
warning: Invalid argument supplied for foreach() in /home/www/www.mywebsite.com/update.php on line 340.
The /tmp/filehVnyRA one is unrelated I think, since I alsa had it on another update.
Here are the query results:
The following queries were executed
twitter module
Update #6500ALTER TABLE {twitter_account} DROP include_retweets
Update #6501
ALTER TABLE {twitter_account} ADD `mentions` INT unsigned NOT NULL DEFAULT 0
Update #6502
No queries
Update #6503
ALTER TABLE {twitter_account} CHANGE `import` `import` INT unsigned NOT NULL DEFAULT 0
Update #6504
No queries
Update #6505
Failed: ALTER TABLE {twitter_account} CHANGE `added_by_uid` `uid` INT unsigned NOT NULL DEFAULT 0
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | twitter-n1994362-7-6.x-5.x.patch | 1.97 KB | damienmckenna |
Comments
Comment #1
mgriego commentedHere's a patch that corrects this. If you're updating from an older version (ie 6.x-3.x), then this will notice if you're running the 6504 update and handle that fact appropriately by using the correct field name rather than what the field name would have been had it been updated previously.
Note, to use this patch properly, your schema_version in the system table must be less than 6504, and updates 6504 and 6505 must not have been run. In actuality, there should probably be some kind of check for update 6502 as well, but this will probably get most people going who run into this because, like us, they updated from a 3.x version.
Comment #2
joachim commentedIt looks like hook_update_n() function was changed, and they should never be:
The 6504 update should never have been changed, even if 6505 was added to remove the field it adds. It that means that users upgrading from 6.x-2.x, or indeed from earlier on the 6.x-5.x branch, have their update.php add the field, *only to remove it seconds later*, then that is what needs to happen.
The correct fix here is to restore 6504 to what it was originally.
Comment #3
mgriego commentedAs long as update 6504 is safe to reinstate, then, yes, that would probably be the better option. The problem is that it's been released in this state, so the final solution may actually require a *new* update function to undo any damage done by this to existing installations.
Comment #4
joachim commentedIt's impossible to add a new update function to fix this problem, because you can't renumber them. We currently have:
- 6504: does nothing
- 6505: tries to rename a field that doesn't exist
Anything you would add would be 6506, which would be powerless to affect the error.
The only fix is to restore 6504, and make a new release with that fix.
Comment #5
summit commentedHi,
Can I ignore the errors on a production site? Because somewhere it says the update tries to remove a field which is not there..
So should the field added_by_uid be added?
Thanks for your reply!
Greetings, Martijn
Comment #6
Michael-IDA commentedIf you are Upgrading:
Twitter (twitter) 6.x-3.0 6.x-5.1 Installed version not supported
Then it looks like you can ignore this warning. In 6.x-3.0, field twitter_account.uid already exists and there is no twitter_account.added_by_uid field to rename.
Drush:
cat twitter.install:
Condensed version of changes:
Comment #7
damienmckennaSo it should do a conditional check in twitter_update_6505() to see if the field exists and only rename it if needed.
Comment #8
damienmckennaCommitted.