Getting this error when upgrading from D6

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://127.0.0.1/d7/update.php?id=2384&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function fivestar_get_tags() in /var/www/d7/sites/all/modules/fivestar/fivestar.install on line 38

I also tried to upgrade without this module enabled and got the same issue, strange that i do not have this module enabled

mysql> select name, status from system where name='fivestar';
+----------+--------+
| name     | status |
+----------+--------+
| fivestar |      0 |
+----------+--------+
1 row in set (0.00 sec)

Comments

marcoka’s picture

had that too when updating. copied the function into the *.installl for updating :)

clemens.tolboom’s picture

Drupal 7 runs the install files even when a module is disabled.

I tried to fix this by adding module_load_include

function fivestar_update_7201() {
  module_load_include('module', 'fivestar');
  $fields = field_read_fields(array('module' => 'fivestar'));
  $tags_numeric = array_values(fivestar_get_tags());

Unfortunately it failed on the next update

Update #7203

    Failed: FieldException: Attempt to create a field of unknown type <em class="placeholder">fivestar</em>. in field_create_field() (line 106 of /home/iafmd/d7.iaf-methods.org/htdocs/modules/field/field.crud.inc).

So what I did was
1. move the fivestar module out of the drupal tree.
2. run update.php
3. move fivestar back into the drupal tree
4. enable fivestar
5. visit update.php again.

My guess is fivestar should add module_load_include('module', 'fivestar'); to update 7203. But that probably need more like a reload of the field definitions by a cache_clear_all(); ?

ericduran’s picture

clemens.tolboom’s picture

Priority: Normal » Major

Set to major as this is a pitb :(

I copied over the code from #1336688: Fivestar breaks upgrade to Drupal 7 thanks to SangersDrupalDude just as a reminder

/**
 * Fixes the axis value stored for fivestar fields
 */
function fivestar_update_7201() {

  include_once 'fivestar.module'; // added to make fivestar_get_tags available!!!!!!

  $fields = field_read_fields(array('module' => 'fivestar'));
  $tags_numeric = array_values(fivestar_get_tags());
 
  foreach($fields as $field) {
    if (is_numeric($field['settings']['axis'])) {
      $field['settings']['axis'] = $tags_numeric[$field['settings']['axis']];
    }
  }
}
marcoka’s picture

today again :)
above code fixes that

ericduran’s picture

patches are always welcome :)

ericduran’s picture

Status: Active » Fixed
dgtlmoon’s picture

fantastic work!

ericduran’s picture

Sorry it took so long :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

florisg’s picture

it breaks on the module check:
1) enabled the module
2) commented out the include function

function fivestar_update_7201() {
//include_once 'fivestar.module';
  $fields = field_read_fields(array('module' => 'fivestar'));
  $tags_numeric = array_values(fivestar_get_tags());

3) ran update

drush updatedb
The following updates are pending:

fivestar module :
7203 - Convert all existing fivestarnode_type settings into fields with exposed fivestar formatters
7204 - Preserve settings from fivestar_formatter_exposed_stars and convert to fivestar_formatter_default.
7205 - Rename fivestar 'select' widget to 'fivestar_select' @see http:drupal.orgnode1285456

Do you wish to run all pending updates? (y/n): y
Performed update: fivestar_update_7203 [ok]
Performed update: fivestar_update_7204 [ok]
Performed update: fivestar_update_7205 [ok]
Finished performing updates. [ok]

Thanks for the great lead to solving this :)

florisg’s picture

Issue summary: View changes

add debug