Posted by kbahey on April 30, 2009 at 1:27am
3 followers
| Project: | Fivestar |
| Version: | 6.x-1.14 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
<?php
/**
* 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;
}
?>
Comments
#1
Dohh. Thanks kbahey. :P
On top of this I realize now that my release notes are incorrect in saying an update isn't needed.
#2
I shortened up the changes by just returning $ret early. Let me know if this requires any further changes. Thanks!
#3
Looks OK. Functionally the same.
Can't test it since I ran my version already on the site in question.
#4
Updating 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.
#5
#6
Automatically closed -- issue fixed for 2 weeks with no activity.