An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://vandenzen.nl/drupal/update.php?op=selection&token=uqhf6UZUWbVi6lc... StatusText: OK ResponseText: Fatal error: Call to undefined function _update_7000_field_read_fields() in /home/sites/vandenzen.nl/public_html/drupal/modules/field/modules/text/text.install on line 78

The error did not occur on another site (I have a multisite environment). The site that caused the error was installed in a subdirectory with some hacks in .htaccess.

To repair this error, I included an extra line in text.install:
require_once DRUPAL_ROOT . '/modules/field/field.install';
The update process continued.

Comments

twowheeler’s picture

That works. I had the same error, but no multisite install. Drupal is installed in a subdirectory under the web root and RewriteBase is set to /web in .htaccess, but I don't know if that matters. At any rate, adding this line to text.install allowed the upgrade to complete. Thanks!

bok11’s picture

I confirm - this solution works :)

dkingofpa’s picture

Component: install system » database update system
Status: Active » Needs review
StatusFileSize
new668 bytes

I was having this issue as well when upgrading core from 6.24 to 7.12 via the drush updatedb command.

Executing text_update_7000 [72.11 sec, 29.46 MB]                                                                                                                                            [notice]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                              [error]
Error: Call to undefined function _update_7000_field_read_fields() in /Users/dking/Projects/test/upgraded.www.test.org/modules/field/modules/text/text.install, line 78 [72.11 sec, 29.46 MB]
Output from failed command :                                                                                                                                                                            [error]
 
Fatal error: Call to undefined function _update_7000_field_read_fields() in /Users/dking/Projects/test/upgraded.www.test.org/modules/field/modules/text/text.install on line 78 [72.11 sec, 29.47 MB]

I set a dependency on the text module so it's upgrade isn't run before the fields module is enabled (system_7020). Patch attached.

dkingofpa’s picture

Version: 7.10 » 7.x-dev
zach.bimson’s picture

Priority: Minor » Normal

I've hit exactly the same problem with my site..
I've tried the first fix and the patch both resulting in the same thing.
It gets me past the update but returning to the update.php all the same updates are still available..
It then fails to this error..

Update #7007
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-access content' for key 'PRIMARY': INSERT INTO {role_permission} (rid, permission) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1), (:db_insert_placeholder_2, :db_insert_placeholder_3), (:db_insert_placeholder_4, :db_insert_placeholder_5),

Thats not the whole error as its huge but gives you an idea..

Any suggestions ?

dkingofpa’s picture

@zach.bimson
That's a separate issue and I would suggest opening a new ticket if you can't find any previously submitted tickets. Google "drupal upgrade integrity constraint violation primary role permission". Integrity constraint violations with permissions seem to be common during drupal upgrades.

zach.bimson’s picture

@dkingofpa
Thanks for the fast response, i will do.

xtfer’s picture

The solution posted in the original post solves this issue.

I havent tested the patch in #3.

xtfer’s picture

Version: 7.x-dev » 7.12
Status: Needs review » Reviewed & tested by the community

Strike that. Patch in #3 seems to fix it, original solution does not.

tim.plunkett’s picture

Version: 7.12 » 7.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This could likely use tests. Also, are we sure this doesn't need anything in 8.x first?

Anonymous’s picture

patch #3 fixes the issue, pls commit

dawnbuie’s picture

Version: 7.x-dev » 7.9

Should patch #3 be applied to the new Drupal 7 install? Or has it already been committed and should be included in the latest Drupal 7 version?

I'm getting this error after using Drush sup command - upgrading from one local directory to another.

thanks.

tim.plunkett’s picture

Version: 7.9 » 7.x-dev

It has not been committed yet. It still needs automated tests.

dawnbuie’s picture

Version: 7.x-dev » 7.9

I tried applying the patch from #3 and got the message

patch -p1 < undefined_function_during_install-1371216-3.patch 
patching file modules/field/modules/text/text.install
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 67 with fuzz 1.

Is this the whole patch or is it missing something?

diff --git a/modules/field/modules/text/text.install b/modules/field/modules/text/text.install
index 61be748..d09ee78 100644
--- a/modules/field/modules/text/text.install
+++ b/modules/field/modules/text/text.install
@@ -67,6 +67,18 @@ function text_field_schema($field) {
 }
 
 /**
+ * Implements hook_update_dependencies().
+ */
+function text_update_dependencies() {
+  $dependencies['text'][7000] = array(
+    // Text update 7000 uses field API functions, so must run after
+    // Field API has been enabled.
+    'system' => 7020,
+  );
+  return $dependencies;
+}
+
+/**
  * Change text field 'format' columns into varchar.
  */
 function text_update_7000() {
mustanggb’s picture

Version: 7.9 » 7.x-dev
dawnbuie’s picture

Version: 7.x-dev » 7.15

Ok I see the patch did actually work - just gave confusing output.

Well the patch was applied, I ran the upgrade:
$drush sup @new_site

reusing the Drupal 7 core I had patched.

That time I didn't get the 7000 field error but I got the message:

updatedb failed for core

with no further info.

I see other people have been encountering update_7000_field_read_fields() errors as well:

http://drupal.org/node/1228488
http://drupal.org/node/1220602#comment-4776144

I don't know what to try next? Turn off the CCK content module in Drpal 6 before starting the upgrade process?

Try a manual upgrade rather than using the drush site-upgrade module?

Strangely I did have success with drush site-upgrade 2 months ago. I'm not sure if a new bug has been introduced into Drupal 6,7 or Drush site-upgrade.

mustanggb’s picture

Version: 7.15 » 7.x-dev
philsward’s picture

I'm going to throw in my $0.02 about this situation... I too ran into the same error and arrived upon this post. I applied the patch and while it was successful in it's intended purpose, I still had problems with the install. A PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry... The point is, I believe this error is directly related to a subsequent error, not a failed upgrade on the text module... What turned out to fail (causing this error originally) was System Update #7007. I noticed in the following PDOexception error that something to do with the permissions of panels was causing #7007 to fail. I re-enabled all of the panels modules and noticed that my "administrator" role, was not checked for mini panels. (Looking at the original untouched site, this was indeed checked). I think that when disabling all of the contrib modules (and I do core too) something messed up the permissions for that module. I re-enabled the permission setting, disabled panels and ctools again and the upgrade went through without a hitch.

If you are getting the error described here, "continue to the error page" link on your site. You should be presented with the normal drupal error's of why the upgrade failed. "If" you're getting a PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry... error, chances are you have some permissions that are completely borked. The very first item should give you an idea of where to start, for example in http://drupal.org/node/1421518, he has a problem with '14-3-workflow_access'. I'm guessing something to do with the permissions for his workflow module or content type is causing the problem.

Hope this helps someone else!

vojnar’s picture

#3works please commit

philsward’s picture

In doing some more testing, my theory (in my case) for my comment #18 was indeed the cause of the error.

Panels "mini-panels" permissions for the "Administrator Role", caused the hangup in my upgrade. My fix was to simply uncheck the mini-panels permissions for the administrator role on D6, before the upgrade. (I didn't re-check and save, just left them unchecked and upgraded) The upgrade went through without a hitch!

It appears to me that the permissions are getting borked on various modules. Instead of creating a workaround to the issue, it might be worth adding something to the upgrade process to check / rebuild all of the module permissions before performing the upgrade? Just a thought.

leo pitt’s picture

The patch in #3 works for me also ... please commit

13rac1’s picture

@vojnar and @Leo Pitt this patch cannot be committed until tests are written.

parasolx’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

Tested and work. upgrading D6 to D7 with 10000+ nodes without any problem.

13rac1’s picture

Status: Reviewed & tested by the community » Needs work

If you want this committed someone must write the automated tests. Please stop changing the status.

rituraj.gupta’s picture

Hi,

I am migrating a drupal 6 website to drupal 7 and I am facing so many issues. when update is done, below some issues occur:

The following updates returned messages
node module
Update #7000

Failed: DatabaseSchemaObjectExistsException: Cannot rename field node_type.module to base: target field already exists. in DatabaseSchema_mysql->changeField() (line 457 of /home/ds00/public_html/touchoncology/includes/database/mysql/schema.inc).

block module
Update #7002

Failed: DatabaseSchemaObjectExistsException: Cannot rename blocks to block: table block already exists. in DatabaseSchema_mysql->renameTable() (line 307 of /home/ds00/public_html/touchoncology/includes/database/mysql/schema.inc).

system module
Update #7002

Failed: DatabaseSchemaObjectExistsException: Table blocked_ips already exists. in DatabaseSchema->createTable() (line 657 of /home/ds00/public_html/touchoncology/includes/database/schema.inc).

please help.

Infinitee’s picture

rituraj.gupta #25

This error message does not belong in this thread but, try running update repeatedly until all updates are completed.

dkinzer’s picture

#3 works.

aitala’s picture

I am running into this issue now trying to go to D7.56 on a site where I had no issues a few months back - at least doing the Drupal update. I got into doing the CCK field migration just fine...

The patch does not seem to work.

Does anyone have an idea?

Thanks,
Eric

Aldu_boy’s picture

Drupal 7.69, ungraded from 6.38

The issue is still there.

Edited text.installb manually by addding changed from patch (I have no ssh to apply patch) and added the line:
require_once DRUPAL_ROOT . '/modules/field/field.install';

this fixed the issue.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.