localgovdrupal / localgov_paragraphs

Configuration and dependencies for paragraphs components for the LocaGov Drupal distribution.
GNU General Public License v2.0
0 stars 5 forks source link

Update hook in localgov_subsites_paragraphs new install file fails to check for field existence #195

Open ctorgalson opened 3 weeks ago

ctorgalson commented 3 weeks ago

The update hook creates two new fields for the localgov_paragraphs module, but fails to check if they're already present.

This means a workflow like that shown below will fail on the final step because drush updb creates the fields, so the subsequent drush cim step finds the fields and config already exist.

ctorgalson commented 3 weeks ago

In fact, testing shows that this is only a problem if drush cim runs before drush updb (contrary to drush deploy's order).

Nevertheless, it has happened, so the update hook should check before creating new fields and config.

louwrense commented 3 weeks ago

@ekes I've confirmed with @tran-bigbluedoor that the PR above is working. Running this updated hook on a project where those fields are already in config no longer causes the import to fail. So all good from our side, thank you.