Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\www\webapps\drupal\update.php on line 309.
* warning: Invalid argument supplied for foreach() in C:\www\webapps\drupal\update.php on line 542.
Comment | File | Size | Author |
---|---|---|---|
#4 | taxonomy_context_hook_update_2.patch | 1.07 KB | Agileware |
Comments
Comment #1
kingandy CreditAttribution: kingandy commentedHmm ... you should NEVER call hook_install from inside a hook_update_N. (This is because the behaviour of hook_install may change in a later update, and potentially people could try updating both hook_update_N steps at once. hook_update_N should bring the database up to the state it needs to be at the time it was written, not whatever the current state happens to be.)
That said - the above is unrelated to this error, which can probably be resolved simply by adding a
return array()
(see hook_update_N() documentation). For preference, the array should be populated via update_sql() calls ... one for each query, so people know what's going wrong (if applicable).Taking all of this into account, the hook should look something like this:
Obviously for best practice you'd include a
switch ($GLOBALS['db_type']) { }
block, but life's too short.Comment #2
kingandy CreditAttribution: kingandy commentedOne more thing: for best best practice, you'd be copying all of the data from the old tables into the new one. This is supposed to be a seamless update, after all - an alternative to uninstalling and reinstalling.
Comment #3
NancyDruThis is not a problem for the 6.x release. If someone wants to back-port a fix to 5.x, re-open this issue with a patch.
Comment #4
Agileware CreditAttribution: Agileware commentedHere is a patch that implements the fix in #1
It's against 5.x-2.0