Problem:
Migrating a site using D6 nodehierarchy 6.x-1.x-dev to D7 2.x dev, when running update.php, NH causes:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://sislabsx.vptt.ch/drupal7/update.php?id=7557&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function db_fetch_object() in /disk2/www/drupal7/sites/all/modules/nodehierarchy/nodehierarchy.install on line 69
The update process was aborted prematurely while running update #6200 in nodehierarchy.module.
Looking at the code, its not abvious why db_fetch_object() should cause an issue:
function nodehierarchy_update_6200() {
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'nodehierarchy') . '/nodehierarchy.module';
$out = array();
$schema = nodehierarchy_schema();
db_create_table('nodehierarchy_menu_links', $schema['nodehierarchy_menu_links']);
$result = db_query("SELECT nh.*, n.title FROM {nodehierarchy} nh LEFT JOIN {node} n ON n.nid = nh.nid ORDER BY nh.parent");
while ($node = db_fetch_object($result)) {
Any suggestions on where to dig?
Comments
Comment #1
joeredhat-at-yahoo.com commentedI'm seeing this as well -- did you ever figure out why it was happening?
Comment #2
boran commentedSorry no. I'm not using NH any more.
Comment #3
antatar commenteddb_fetch_object() is discontinued in D7.
Is there an equivalent?
Comment #4
ksward commentedI am also able to reproduce this error consistantly.
Comment #5
ksward commentedUpdate to my last post-- During the migration is when I experience the failure, if I wait to install and enable the module untill after the update/migrate is completed the module installs and enables with no error. The Node Hierarchy menu item is available and functions. The upgrade does not maintain the node integrity.
Comment #6
hoai commentedFrom
while ($node = db_fetch_object($result)) {.You need change to
while ($node = $result>fetchObject()) {and number row 71 to:
if ($menu_link = db_query("SELECT * FROM {menu_links} WHERE plid = :plid AND link_path = :link_path", array(':plid' => $plid, ':link_path' => 'node/%d', '' => $node->nid))->fetchAllAssoc()) {i test it and it is working.
Comment #7
hschott commentedI'm having this issue too. When I 1st run update.php, I get this error:
nodehierarchy module
Update #6200
Failed: DatabaseSchemaObjectExistsException: Table nodehierarchy_menu_links already exists. in DatabaseSchema->createTable() (line 657 of C:\xampp\htdocs\d7.ehealthmd.com\includes\database\schema.inc).
If I remove the nodehierarchy_menu_links table from the database and run update.php again, I get this error:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://localhost/d7.ehealthmd.com/update.php?op=selection&token=BGbDi4S5... StatusText: OK ResponseText: Fatal error: Call to undefined function db_fetch_object() in C:\xampp\htdocs\d7.ehealthmd.com\sites\all\modules\nodehierarchy\nodehierarchy.install on line 69
I tried what was suggessted in #6, changing the nodehierarchy.install file, but that didn't work. I also tried disabling/deleting the module and starting over. No success.
Is there a solution?
Thanks!
Comment #8
sylvain lavielle commentedI had this problem during a D6 -> D7 Upgrade. It was due to the nodehierarchy version :
If you try to upgrade your site with a nodehierarchy-6.x-1.x (last version) the error raise up because the hook_update_6200 still unapplied on D7 after site upgrade. So it try to update on D7 with old API calls in it.
To avoid this, on D6, update nodehierarchy-6.x-1.x to latest nodehierarchy-6.x-2.x then upgrade to D7
it worked for me.
Comment #9
hschott commentedSorry for my late response, I've been working with this update for a while. Updating to 6.x-2.1 did solve the problem and the update error is gone.
However, once I upgraded to the 6.x-2.1 version, my pages that use nodehiearchy completely loose the style sheet as well as everything in the tags. So there's no header or admin menu on those pages. I've been looking in the issue queue as well as google and don't see anything related. Any suggestions? Actually I think I need to ask this question in a d6 forum for nodehiearchy.
Thanks for your help!
Comment #10
leisurman commentedThank you #8
Yes it worked.
on D6, update nodehierarchy-6.x-1.x to latest nodehierarchy-6.x-2.x then upgrade to D7 and install nodehierarchy-7x-2.x