Problem/Motivation
We updated from 2.0-alpha4 to 2.0-beta2. The views reference fields are on Commerce product entities. We are now getting a lot of PHP notices in the Drupal error log with information such as the following:
Message Notice: Undefined property: stdClass::$field_display_photos__title in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables() (line 1288 of /home/shedsandstuff/public_html/lanc/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php)
Steps to reproduce
If a views reference field is on Commerce product entity, and there is existing data in the field, update from 2.0-alpha4 to 2.0-beta2. See the Drupal log.
Proposed resolution
Could be related to https://www.drupal.org/project/viewsreference/issues/2824292. Does the update script need to include product entities?
Remaining tasks
If someone would know how to create a patch or script that would fix the error messages, we would be much obliged.
Comments
Comment #2
someshver commentedI had a similar issue with field_image
Undefined property: stdClass::$field_image_alt in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables() (line 1288 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).The Error occurs when there is some column missing in the database table. In your case, the field_display_photos__title column is missing from the tables node_field_display_photos and node_revision_field_display_photos
and in my case the column name is field_image_alt so we need to add column first.
After that run update.php. After all this process you can delete the field and create new field with similar name.
Thanks
Comment #3
someshver commentedComment #4
almador commentedI'm occurring the same problem in two fields.
When I'm trying to edit fields settings:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_nameWarning code:
Warning: Undefined property: stdClass::$field_name in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables() (line 1267 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).Comment #5
almador commentedAnd yes, this the fields with '_argument' at the end.
After examining the viewsreference.install code I realized that problem was with the columns with _argument and _title at the end. This is the custom module code I've used to fix the problem:
After enabling this module:
Comment #6
seanbCould you check if #2925609: Update viewsreference_update_8103 fails if table name is too long and shortened by Drupal solves the issue?
Comment #7
seanbClosed as duplicate of #3268551: Update to 2.0 loses data from '_data' column.