Problem/Motivation

#2733331: Store as sequence introduced a post update hook for changing the configuration to a sequence but if the hook is run after the configuration has already been updated (by a config sync operation, for example) the execution will fail and remain stuck.

Example error message from database update script

InvalidArgumentException: The configuration property third_party_settings.allowed_formats.allowed_formats.0.0 doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of /app/docroot/core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

Proposed resolution

Update the post update hook to take no action on configuration that has already been updated (patch incoming).

CommentFileSizeAuthor
#2 3261891-2.patch877 byteswells
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

wells created an issue. See original summary.

wells’s picture

Status: Active » Needs review
StatusFileSize
new877 bytes

Patch attached based on proposed resolution.

yuseferi’s picture

Nice!
worked for me

jklmnop’s picture

#2 worked for me too.

kjwhite’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch in #2 successfully.

mvogel’s picture

+1

duaelfr’s picture

Nice patch! Thanks :)

abu-zakham’s picture

+1

artusamak’s picture

I can also confirm that #2 is fixing the issue. Thank you for the patch.

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

dww’s picture

Another +1 for the RTBC. Hit exactly this problem and patch #2 solves it. I can't find anything to complain about for the patch: comment is clear, code looks good. Confirmed it solves the problem. I don't know that we need an automated test for this, I think we should just fix it.

If I were a maintainer here, I'd remove credit from @Sashaz for clicking the link to create an issue fork when there's already a patch and doing nothing else with it. Creating an MR would be pointless for such a small patch. IMHO, this looks like someone trying to game the credit system without doing any meaningful contribution...

Anyway, thanks @wells for opening the issue and the nice patch, and everyone else who actually tested this to confirm it's working!

Cheers,
-Derek

  • wells authored b906529 on 8.x-1.x
    Issue #3261891 by wells: Post update hook fails when config is already...
nord102’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for catching this and for the patch @wells. Thanks everyone else for all of the feedback.

Status: Fixed » Closed (fixed)

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

eelkeblok’s picture

For those stumbling upon this after the fact, one puzzling aspect of this is that our deployments always do updates *first* and only then do a config import, so this really shouldn't happen. It did anyway.