Regression fix for Change wxt_core countries config name

Created on 14 November 2023, about 1 year ago
Updated 19 December 2023, about 1 year ago

Problem/Motivation

Spun from:
#3399929: Change wxt_core countries config name

Steps to reproduce

  1. Upgrade to any drupalwxt/wxt commit hash some time between monday and friday the 10th of November
  2. delete the countries yml that was brought in
  3. then later upgrade to the latest drupalwxt/wxt
  4. run update hooks, crash on 8502

Proposed resolution

See patch

Remaining tasks

Review patch

User interface changes

N/A

API changes

update hook 8502 and 8501

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇨🇦Canada joseph.olstad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joseph.olstad
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇨🇦Canada smulvih2 Canada 🍁

    @joseph thanks for opening a new ticket for this! Will see if I can reproduce the issue to test this fix.

  • 🇨🇦Canada jmdeleon

    Was getting this same error. Patch in #2 fixes it.

  • Status changed to Needs work about 1 year ago
  • 🇨🇦Canada SKAUGHT

    step 2. delete the countries yml that was brought in

    I'm assuming #6 also manually deletes your own config too.

    // Update hook 8501 wasn't run correctly for some reason, or the yml was deleted.
    in your patch you commented.
    also: you do reset 8501 with the new namespace than it was it updated. (ln 678 after patch #2). this changes the condition to see if a user actually changed any config in their site. is this confirmed?

    DOCUMEATION?
    How did you delete the config to begin this test? It's as much a fail point should someone have the ability in an install to manually delete an active config. We are patching against a dev line if not just from the 5.0.1 release, changing hashes and dropping a config...

  • Status changed to Needs review about 1 year ago
  • 🇨🇦Canada joseph.olstad

    @SKAUGHT

    An alternative test is this:

    Remove the countries yml from your filesystem
    import the configs so that it's deleted from your schema.

    Now run the following drush commands.

    drush eval "\Drupal::service('update.update_hook_registry')->setInstalledVersion('wxt_core', 8501);";
    drush updb -y;

    doing this without the patch will crash your system

    add the patch and the countries are brought in correctly without crashing.

  • 🇨🇦Canada SKAUGHT

    Your overlaying a rollback situations.. I get that..

    - physically removing the config form FS, then reset instance of triggered hook.
    I do see this is a complex developer sequence to cause a fail. is this real-world then from the 5.0.1 release. or any sites that upgrade from v4 itself?

    In the moment this seems more like {entity}->isNew() doesn't catch something as could be hoped..

  • 🇨🇦Canada SKAUGHT

    @joseph.olstad
    how does this feel to you sir!

  • 🇨🇦Canada joseph.olstad

    Hi @SKAUGHT,
    I deleted my countries yml then I ran your patch, set the schema version to 8501, ran updb, the end result is that I no longer had any countries.

    The countries were not restored.

    I prefer patch #2 because it brings back the countries.

    I also re-tested patch #2 , if I have the correct countries value, there's no crashing.

  • Status changed to RTBC about 1 year ago
  • 🇨🇦Canada SKAUGHT

    Okay, that sound good to me too!

    let move with patch #2.

  • Status changed to Fixed about 1 year ago
  • 🇨🇦Canada sylus

    Committed and attributed thanks for the fix everyone :D

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

  • Status changed to Fixed about 1 year ago
  • 🇨🇦Canada joseph.olstad

    fixes we made to 5.0.x were not fully merged into 5.1.x

    I just got tripped up on this with 5.1.0 , made a new ticket here:

    #3409755: 5.1.x requires some merges from 5.0.x - countries fix is missing

Production build 0.71.5 2024