Needs review
Project:
Taxonomy context
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2009 at 14:47 UTC
Updated:
31 Jan 2010 at 23:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
kingandyHmm ... 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
kingandyOne 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 commentedHere is a patch that implements the fix in #1
It's against 5.x-2.0