Closed (fixed)
Project:
Fivestar
Version:
6.x-1.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2009 at 01:27 UTC
Updated:
20 May 2009 at 21:00 UTC
Jump to comment: Most recent file
On a site where CCK is not installed, update 6105 fails because the functions called do not exist.
Here is a replacement function that fixes it, by checking if content module is installed first.
/**
* Belated update for Drupal 6: Re-enable Fivestar CCK fields.
*/
function fivestar_update_6105() {
$ret = array();
if (!module_exists('content')) {
$ret[] = array('success' => TRUE, 'query' => t('CCK is not installed. No need to update.'));
}
else {
if ($abort = content_check_update('fivestar')) {
return $abort;
}
// All CCK fields are disabled by Content module during the D6 upgrade.
// Re-enable the Fivestar fields.
module_load_include('inc', 'fivestar', 'fivestar_field');
content_associate_fields('fivestar');
$ret[] = array('success' => TRUE, 'query' => t('Re-enabled Fivestar CCK fields.'));
}
return $ret;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fivestar_content_update_fix.patch | 917 bytes | quicksketch |
Comments
Comment #1
quicksketchDohh. Thanks kbahey. :P
On top of this I realize now that my release notes are incorrect in saying an update isn't needed.
Comment #2
quicksketchI shortened up the changes by just returning $ret early. Let me know if this requires any further changes. Thanks!
Comment #3
kbahey commentedLooks OK. Functionally the same.
Can't test it since I ran my version already on the site in question.
Comment #4
quicksketchUpdating title for completeness. Anyone affected by this issue, do not worry. If you don't have CCK installed you'll get this error, but it doesn't do any harm since there is nothing needed to update. I've released the 1.15 release to fix this update problem. Download the new version and try running the update again.
Comment #5
quicksketch