Problem/Motivation

The newly added localgov_elections_update_10008() and localgov_elections_update_10010() update hook implementations are overwriting existing configs while updating those configs. Affected configs include:
- core.entity_form_display.node.localgov_area_vote.default
- core.entity_view_display.node.localgov_area_vote.default
- core.entity_view_display.node.localgov_area_vote.teaser

After running these updates, the UUID is gone along with mentions of some fields from other modules; example: localgov_service_contacts, localgov_services_parent, etc.

This issue only affects existing users of this module.

Steps to reproduce

$ composer update drupal/localgov_elections
$ drush updatedb
$ drush config:export
$ cd /path/to/drupal/config/store/
$ git diff 

Suggested testing steps

  1. Install localgov_elections 3.1
  2. Enable localgov_elections demo_content
  3. Enable localgov_demo_content
  4. Make some customisations to area vote form or view displays
  5. Get the branch code.
  6. Run drush updb
  7. Updates should apply the configuration without affecting other customisations

Risks to consider

Update hooks were already run from 3.2.0

Release notes should mention the issue and suggest manual updates to desired state.

Proposed resolution

localgov_elections_update_10008() and localgov_elections_update_10010() should alter existing configs rather than overwriting them with their newest copy from /config/install/. localgov_elections_update_10009() offers a good example.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

progga created an issue. See original summary.

tonypaulbarker made their first commit to this issue’s fork.

tonypaulbarker’s picture

Issue summary: View changes
Status: Active » Needs review
tonypaulbarker’s picture

Issue summary: View changes
progga’s picture

Looks okay to me. Thank you Tony for the midnight fix :)

Test steps I followed:
- Setup a fresh LocalGov Drupal site with localgov_elections:3.0.0.
- drush config:export --yes
- composer update drupal/localgov_elections
- Grabbed a fixed copy of the localgov_elections.install file.
- drush updatedb
- drush config:export --diff

progga’s picture

Status: Needs review » Reviewed & tested by the community