Sunday 23 December 2012

Fatal error: Call to undefined function field_attach_load() in C:\commerce_kickstart-7.x-2.0\includes\entity.inc on line 321

There is a new Commerce Kickstart.
Installing it is slow but possible. An option is not to use the special shopkeepers' toolbar. I chose not to, because I have been trying some of the videos on http://nodeone.se/sv/learn-drupal and wanted to use the same default tooblar, but without it I didn't manage to follow the product-adding instructions.

  • With hindsight, I could have googled "Toolbar_magicmenu" and installed the .gz file by clicking "modules" on the admin menu and using the box where you can paste-in the url of a module to install before pressing "install", and probably something after like "enable". Next, "Commerce_Kickstartmenu".
  • With a reset option to go back to the default install, I can try to do just that, using a confirmation button which says "Kill Me!", as you do.

Having killed my product-less site, I try again:

Fatal error: Call to undefined function field_attach_load() in C:\commerce_kickstart-7.x-2.0\includes\entity.inc on line 321

Two or three attempts to use control+backarrow, retype second password and click return all fail.

Attempt: I cut the question mark and everything after it from the url and pressed return. This takes me back one stage further in the installation process to a page beginning "

Welcome

Thank you for choosing Commerce Kickstart!

I click the "get started" button and fill-in the usual name for the test site. Result? (from memory)
Fatal error: Call to undefined function field_attach_load() in C:\commerce_kickstart-7.x-2.0\includes\entity.inc on line 321

bugger.

On googling the error message I find that Commerce Guys have been producing this syrup-voiced set of videos as though Drupal worked, while some 57 different people in one thread alone out of two or three. Solutions are often highly technical and require knowledge of databases and php files. I am using the most basic installation on an Aquia stack, using a Windows XP computer but it seems that software vendors are unaware of the problem and just use glib meaningless phrases like "right out of the box" instead of addressing problems.

One of the solutions posted was to "clear the database cache". I am using Aquia Drupal Stack Installer as suggested in the Tom Geller Youtube video. There is a button for databases. I found one table in this base for cache and deleted the contents. Some success: I now have a basic drupal default logon screen, but no username and password. Another table in the base - the last on the list I think - had "placeholder" for user 1 and password, so I added that and an email and tried again. Is this the start of a revived Commerce Kickstart? No.


Fatal error: Call to undefined function field_attach_load() in C:\commerce_kickstart-7.x-2.0\includes\entity.inc on line 321

I can find the file on my hard disc and have a look. Line 321 is the third last of this paragraph:

  protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
    // Attach fields.
    if ($this->entityInfo['fieldable']) {
      if ($revision_id) {
        field_attach_load_revision($this->entityType, $queried_entities);
      }
      else {
        field_attach_load($this->entityType, $queried_entities);
      }
    }  


Using Notepad++ as a handy bit of free editing software I try turning "FALSE" into "TRUE" in the file above. No difference in outcomes. I try deleting contents of the cache again. Same again. This is a bit like trying to fly without any wings and I have no idea what I am doing

here are some Ubercart instuctions. Ubercart hopes to be a shortcut to writing ecommerce sites using Drupal.
Transcribed videos: -
[Drupal 7 / Ubercart video tutorial 7 of 10 showed how to use the default catalog module]
[Drupal 7 / Ubercart video tutorial 8 of 10 showed an alternative flexible method of showing a catalog]
[Drupal 7 / Ubercart video tutorial 9 of 10 shows how to use product kits, stock, and order states]
[Drupal 7 / Ubercart video tutorial 10 of 10 shows a simple checkout, reports, and suggests a theme