im getting this error on installation

SCREAM: Error suppression ignored for
( ! ) Fatal error: Call to undefined function field_attach_load() in C:\wamp\www\NPCS.server.com\drupal-7.22\includes\entity.inc on line 321

when i save the configure site settings...... any one with some suggestions

Comments

John_B’s picture

It looks as though you have some code missing: http://api.drupal.org/api/drupal/modules%21field%21field.attach.inc/func.... (ie the function should be defined at modules/field/field.attach.inc, line 622) I would start by checking the the field.attach.inc file containing the allegedly undefined function exists on your installation, that the core Field module is enabled, and that you have not modified Drupal core in any way.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

lgodare’s picture

When installing 7.22 fresh, either "standard" or "minimal", the install fails with this error:
Fatal error: Call to undefined function field_attach_load() in C:\xampp\htdocs\drupal\includes\entity.inc on line 321

The error occurs at the point of saving the "Configure Site" page.

I checked in modules/field/field.attach.inc. The function is defined. The file is clearly not being loaded/included at the point of failure.

My solution was to download and install 7.21 instead. That installed without error.

jprj’s picture

I'm doing a clean rebuild of my site and I get exactly this problem when trying to install 7.22. I propose to cure it the same way by using 7.21 and then upgrading!

murias’s picture

Wondering if there might be a solution to this. I have exact same problem. Might this be a server issue? Sad thing is that I have a few other installations of Drupal on this server and had no problems running those installation scripts.

Murias

andlil’s picture

During installation of version 7.22

Fatal error: Call to undefined function field_attach_load() in /////includes/entity.inc on line 321
when i save the configure site settings.

John_B’s picture

There is live issue for this https://drupal.org/node/481758 where a number of causes are suggested, e.g https://drupal.org/node/481758#comment-6891826

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

murias’s picture

Specifically for my situation, the issue was that I was running PHP 5.4. I had found a patch for core which solved it for me. You may find that patch here:
1525176-fix entity conditions-D7.patch

Hope this helps some out there.

Murias

murias’s picture

Specifically for my situation, the issue was that I was running PHP 5.4. I had found a patch for core which solved it for me. You may find that patch here:
1525176-fix entity conditions-D7.patch

Hope this helps some out there.

Murias

dustinsilva@gmail.com’s picture

Thanks for the patch! This fixed my installation problem I was having.

Fatal error: Call to undefined function field_attach_load() in includes/entity.inc on line 316

I had to:

  1. delete the existing mysql database: drop database drupal7xdev;
  2. create the mysql database: create database drupal7xdev;
  3. run install.php again

*note that I chose to name my database 'drupal7xdev', your database will undoubtedly be named something different.

**note!!! This was a new installation, if you have an existing site, please do NOT drop your database unless you want to lose all your data!!!!!!!!! (you've been warned)

D-Lef’s picture

That worked for me, awesome!

colepacak’s picture

thanks dustin.silva. +1

dustinsilva@gmail.com’s picture

Anytime colepacak!

drupalove’s picture

Running PHP 5.4 on xampp, dropped the database tables and tried again without applying the patch. Chose standard profile and everything went ok the second time.

masstechnologist’s picture

@ drupalove

Thanks it worked for me as well.

drewind’s picture

@drupalove thank you, this worked for me as well.

D-Lef’s picture

Look @ dustin.silva comment. (for new installation)

Jorge Ruiz’s picture

Dear, wanted to comment that this was the solution I found to this problem:

1. Deleting mysql database.
2. Recreate the mysql database using utf8_general_ci.

I hope this helps you.

srikanth.g’s picture

I got same error while installing https://www.drupal.org/project/commerce_profile
Fatal error: Call to undefined function field_attach_load() in commerce_profile\includes\entity.inc on line 354
Recreating the mysql database using utf8_general_ci fixed the issue,this point should be mentioned in distro documentation

Mugé’s picture

The patch had three lines that were different from the original entity.inc file (Drupal version 7.30).
1- // Exclude any entities loaded from cache if they don't match $conditions. //removed line
2- // This ensures the same behavior whether loading from memory or database. //removed line
3- if ($conditions) { //changed if to elseif

I didn't know how to apply the patch.
Below are links for patch newbies like me:
https://www.drupal.org/node/534548
https://www.drupal.org/node/620014
may work for some as it has clear instructions, but I was confused with the manual method and I didn't have the patience to follow through with Cygwin.

I used Netbeans.

1- Saved the patch as .txt
2- In Netbeans, went to >Tools >Diff >opened up patch-file.txt file >save by clicking diff button as patch-file.patch file as it only recognizes the .patch / .diff extension.
3- Opened up entity.inc
4- clicked the arrows to transfer code into entity.inc document.

Worked after database tables were deleted. Mine is a new set-up, so I am not worried of deleting my tables, but if you have data, definitely back it up, as also suggested above.

Thanks for all the help!

realgiucas’s picture

As Jorge Ruiz commented, recreating the database as utf8_general_ci solvs the problem

HTTV’s picture

What do I do? I just keep getting this error message and it is live on my site. i have no access to main control area in drupal at all.

Fatal error: Call to undefined function nucleus_get_predefined_param() in /home/hometown/public_html/sites/all/themes/zircon/inc/preprocess_functions.inc on line 57

John_B’s picture

Your question seems unrelated to the thread.
You probably need to work from command line to install base theme 'nucleus': https://www.drupal.org/node/1891018

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

nitin.k’s picture

Most of the people face this issue because the referenced module is not loaded or invoked. So I came up with simple solution and that worked for me instead looking and fixing issue for every module.

module_load_all();

This above function should be kept at the right place from where the problem is getting generated. Hope it saves time of someone.

chri5tia’s picture

I tried recreated the database as utf8_general_ci, as others suggested, but I am still getting the problem. I've installed Drupal dozens of times, even in the same environment and have not experienced this issue.

Edit: I forgot to delete the settings.php and create a new one from the default. That was preventing the system from reassessing that I had actually dropped and recreated the database. Before, the installation was skipping over the profile part with all the modules; I'm installing a demo site. After that, it worked. Thanks for all the help everyone.

Pradslion’s picture

I too faced this issue. It occurred because required modules that were supposed to get installed as a part of Drupal installation process didn't got installed successfully. As a result all DB tables didn't got loaded under my site's DB while installation.

What I did:
Deleted all tables that were loaded in my database and made my DB empty. Then tried reinstalling Drupal and this time I saw entire required modules getting installed which in turn resulted in successful installation.