Problem/Motivation

Error in update hook prevents from updating from version 1.0.0-rc1 to 1.0.0-rc2.

Steps to reproduce

  1. Install the module ver. 1.0.0-rc1
  2. Add some fields of type Entity Reference Media with some content.
  3. Update to version 1.0.0-rc2
  4. Run drush updb, there will be an error:

entity_reference_media error on drush updb

I'm not sure, but maybe the error is related to paragraph's fields only.

Proposed resolution

Check if field already exists on update(?).

Remaining tasks

Fix the update hook's code.

User interface changes

API changes

Data model changes

Comments

Granik created an issue. See original summary.

grienauer’s picture

Assigned: Unassigned » dejan0
dejan0’s picture

yes, an update hook is provided here: https://www.drupal.org/project/entity_reference_media/issues/3206403
and it makes sense only when updates from the very first version to rc2.
Fields are already there in rc1, that's why the update hook doesn't work in this case.

Check if field already exists on update(?).

This idea sounds good, I think

grienauer’s picture

Patch is welcome ;P

granik’s picture

Status: Active » Needs review
StatusFileSize
new1.27 KB

Added a patch. Now there is a check if field already exists.

dejan0’s picture

@Granik Looks very good, thanks!

dejan0’s picture

Assigned: dejan0 » Unassigned
Status: Needs review » Fixed

  • dejan0 committed 7d333c4 on 1.0.x authored by Granik
    Issue #3264280 by Granik: Error on update from 1.0.0-rc1 to 1.0.0-rc2
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.