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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3206403_add_new_fields_to_entity_reference_media_field_tables.patch | 1.3 KB | orom |
Comments
Comment #2
grienauerComment #3
dejan0 commented@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
Comment #4
daveianoNoticed that the changes were already introduced in 1.0.0-alpha1 and changed the issue accordingly.
Comment #5
orom commentedTry this patch to add the new fields to all entity_reference_media field type db tables
Comment #6
daveianoPatch from #5 solves this after executing a drush updb.
Comment #7
dejan0 commentedComment #8
dejan0 commentedComment #9
dejan0 commented