Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ctorgalson opened this issue Sep 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ctorgalson
Copy link
Contributor

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.

  • composer install latest on dev
  • drush deploy on dev
  • export config on dev
  • capture new config in repo
  • deploy updated codebase to prod/stage/etc
  • drush deploy on prod/stage/etc
@ctorgalson ctorgalson added the bug Something isn't working label Sep 11, 2024
@ctorgalson ctorgalson self-assigned this Sep 11, 2024
@ctorgalson
Copy link
Contributor Author

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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants