I ran into an issue with the 7.x-2.0 fedex module.

It crashes the update script when trying to run "uc_fedex_update_6200()".

I looked into it and saw you are using a drupal 6.x method in a drupal 7.x module.

Fix below:


// File uc_fedex.install

// Broken in 7.x
function uc_fedex_update_6200() {
  $ret = array();
  $schema = drupal_get_schema('uc_fedex_products', TRUE);
  db_create_table($ret, 'uc_fedex_products', $schema);

  return $ret;
}

// Fix for 7.x
function uc_fedex_update_6200() {
  $ret = array();
  $schema = drupal_get_schema('uc_fedex_products', TRUE);
  db_create_table('uc_fedex_products', $schema);

  return $ret;
}

Comments

tr’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

The hook_update_62xx() functions don't get called when you have Drupal 7 installed, they are only used for updating one D6 version of this module to another D6 version. So the code in these functions should and *must* be D6 code. You don't say what error you're seeing, so it's not clear to me what is really happening. Perhaps you forgot to upgrade to the latest D6 version of this module and run update.php before you tried to upgrade to D7?

d.cochran’s picture

Ah, it was something stupid I did.

I migrated from 6.x to 7.x and didn't update the Fedex module before the migration.

Then I ran the update script which killed it as it tried to run the drupal 6.x updates within drupal 7.

Me changing the drupal 6.x updates within the module fixed it for me. I probably would have never had the issue if I had just updated before migrating.

Sorry.

~dc

d.cochran’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
smptebars1’s picture

Status: Closed (works as designed) » Needs review

I have the same problem as well, and I'm pretty sure I updated the version of fedex I was using before I updated.

here is the error:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://mydomain.com/update.php?op=selection&token=1ZQstLzDuyEUxYPRo7tLId... StatusText: parsererror ResponseText: Fatal error: Unsupported operand types in /includes/database/mysql/schema.inc on line 85

the update process was aborted prematurely while running update #6200 in uc_fedex.module. All errors have been logged. You may need to check the watchdog database table manually

here is line 81-85 in schema.inc :
// Provide defaults if needed.
$table += array(
'mysql_engine' => 'InnoDB',
'mysql_character_set' => 'utf8',
);

I verify what d.cochran was saying

After applying the fix.... it works now
Thanks

tr’s picture

Read what I said in #1. There is nothing wrong with this function, the problem must be that you didn't perform the upgrade correctly.

smptebars1’s picture

Status: Needs review » Closed (works as designed)

okay. But for people that may have forgot to do the update before upgrading, this is a good solution for them.

thanks D

twood’s picture

Had the same issue after upgrading to v7. Just wanted to add a note that this is found in /sites/all/modules/uc_fedex/uc_fedex.install -- took me a few to figure that out.