Problem/Motivation

After upgrading to version 1.0.0-alpha1 iam getting errors when saving a node which uses "Media Enhanced fields" (the field is called 'field_bilder_w_caption' in my case):

Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_bilder_w_caption_default_start_end' in 'field list': INSERT INTO {paragraph__field_bilder_w_caption} (entity_id, revision_id, bundle, delta, langcode, field_bilder_w_caption_target_id, field_bilder_w_caption_default_caption, field_bilder_w_caption_custom_caption, field_bilder_w_caption_default_start_end, field_bilder_w_caption_video_start, field_bilder_w_caption_video_end) 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, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => 1275 [:db_insert_placeholder_1] => 16279 [:db_insert_placeholder_2] => bilder_slider [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => de [:db_insert_placeholder_5] => 610 [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Zeile 846 in /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Steps to reproduce

  • Install and configure module in version prior to 1.0.0-alpha1
  • Upgrade to 1.0.0-alpha1 or later and try to save a node with a Media Enhanced field

Proposed resolution

I haven't looked deeper into this but it sounds to me that there were new fields added in the last update, but the changes were not reflected in a update_hook. It seems that we need an update hook to add the new fields to the DB schema.

Comments

daveiano created an issue. See original summary.

grienauer’s picture

Assigned: Unassigned » dejan0
dejan0’s picture

Status: Active » Needs work

@daveiano thanks for your comment!
yes - exactly, the update path is not supported when updating from `beta` to `rc` version.
`default_start_end`, `video_start` and `video_end` DB schema fields are added in rc1.
So, to make this possible - we have to write update_N hook

daveiano’s picture

Title: Error on save after upgrading to 1.0.0-rc1 » Error on save after upgrading from 1.0.0-beta1 to 1.0.0-alpha1 or later
Issue summary: View changes

Noticed that the changes were already introduced in 1.0.0-alpha1 and changed the issue accordingly.

orom’s picture

Try this patch to add the new fields to all entity_reference_media field type db tables

daveiano’s picture

Status: Needs work » Reviewed & tested by the community

Patch from #5 solves this after executing a drush updb.

dejan0’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
dejan0’s picture

Status: Patch (to be ported) » Fixed
dejan0’s picture

Status: Fixed » Closed (fixed)