Fatal error: Call to undefined function db_fetch_array() in sites/all/modules/user_import/user_import.install on line 201

There is some old 6.x code in the install script that gets triggered on the migration from D6 to D7 when running update.php

CommentFileSizeAuthor
#2 user_import_update.patch2.61 KBburgs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DarrellDuane’s picture

Also, there are calls to update_sql() in this same function which are deprecated.

burgs’s picture

Issue summary: View changes
FileSize
2.61 KB

I've attached a patch that fixes both the issues mentioned, and some other typos etc. Please test.

gisle’s picture

Status: Active » Needs review

Changing status.

gisle’s picture

Title: Fatal error: Call to undefined function db_fetch_array() in sites/all/modules/user_import/user_import.install on line 201 » Remove legacy Drupal 6 code from user_import.install
Version: 7.x-1.x-dev » 7.x-3.x-dev
Assigned: Unassigned » gisle
Category: Bug report » Task

These functions are named user_import_update_6002 so they are user_import_update_6003 implementations of hook_update_N for Drupal 6. They are also present in User Import version 6.4 (the latest stable release of the Drupal 6 branch of the project).

The correct procedure for a major project upgrade it:

  1. Upgrade to the latest stable version of the legacy version, and run upgrade.php to upgrade the database.
  2. Then install the new version of the project code.

If this procedure is followed, the database upgrades would already have happened prior to installation of the Drupal 7 code, and the legacy code would have been ignored.

It does not make sense to upgrade a Drupal 6 version of hook_update_N with Drupal 7 function calls.

What is wrong here is that Drupal 6 functions is retained in a Drupal 7 project. They should simply have been removed to give the Drupal 7 version a clean start.

  • gisle committed 71734b5 on 7.x-3.x
    Issue #1992914 by gisle: Removed legacy Drupal 6 code from user_import....
gisle’s picture

Fixed in most recent snapshot of 7.x-3.x-dev.

gisle’s picture

gisle’s picture

Status: Needs review » Fixed

Changing status.

Status: Fixed » Closed (fixed)

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