backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.language' in 'field list'? #4813

Open realuser opened 3 years ago

realuser commented 3 years ago

I'm trying to convert a drupal 7 site to backdrop. I've run into a few issues the current one being:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.language' in 'field list': SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid, base.vid = revision.vid AS is_active_revision FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 4 )

Error messagePDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.language' in 'field list': SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid, base.vid = revision.vid AS is_active_revision FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 4 ) in DefaultEntityController->load() (line 301 of /backdropsite/core/modules/entity/entity.controller.inc).

Any clues on why this is happening and how to fix it?

indigoxela commented 3 years ago

Error messagePDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.language' in 'field list'

In Backdrop that column has been renamed to "langcode" (in Drupal it was "language").

Renaming of that column should have happened in function node_update_1002(), but apparently that didn't happen when you upgraded. And that makes me think that many other update hooks might have failed, too.

UPDATE: Sorry, some misconception on my side... The column isn't language anymore, but something still seems to search for it... i18n?

Did you see any errors when upgrading? Which modules do you have installed? Can you describe your upgrade steps?

realuser commented 3 years ago

Yes there was an error on the rules module first which I disabled in the database system table and reran update.php

Error Status messageAll files must now be classified according to file types. Your files have been queued for processing, and will have their file type determined during cron runs. Error message Notice: Undefined index: module in _field_info_prepare_instance_widget() (line 417 of /backdropsite/core/modules/field/field.info.inc). Notice: Undefined index: module in _field_info_prepare_instance_display() (line 385 of /backdropsite/core/modules/field/field.info.inc). Notice: Undefined index: module in _field_info_prepare_instance_display() (line 385 of /backdropsite/core/modules/field/field.info.inc). Notice: Undefined index: module in _field_info_prepare_instance_display() (line 385 of /backdropsite/core/modules/field/field.info.inc). Error: Call to undefined function entity_property_info_cache_clear() in rules_flush_caches() (line 484 of /backdropsite/modules/rules/rules.module). Call to undefined function entity_property_info_cache_clear()

I also had an error because I had an outdated webform module so I updated that in the original site and re-exported/imported the db. Note drush up did not report any updates being needed but I was on webform 7.x-3.x and not 4.x

And probably some errors before that.

  1. I set up the backdrop code and database and added several modules from the original site, not sure if was all of them
  2. Erased the backdrop database and created a new blank one
  3. Exported my drupal 7 database to an SQL file
  4. Imported sql file into blank backdrop db
  5. ran update.php
indigoxela commented 3 years ago

All files must now be classified according to file types...

That's OK, cron runs will fix that.

Notice: Undefined index: module in _field_info_prepare_instance_display()

Hm, do you have a field of a type no enabled Backdrop module provides?

Call to undefined function entity_property_info_cache_clear()

One of the Rules module dependencies seems to be missing. That function is provided by the entity_plus module.

Your steps are correct :+1:, but I suspect, you didn't have all necessary modules yet. Hey, there's a helper module you could install on your Drupal site to get more info: https://github.com/backdrop-contrib/backdrop_upgrade_status Important note: that's a Drupal module, not a Backdrop module.