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.
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 CreditAttribution: 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