Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As part of converting field api to CMI we delete and then save a new configuration object - see comment #4 on #1738284: Field API CMI conversion.
This should be a single atomic rename operation instead as both of our config storage class support this - update for the database and rename for the file.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1739900-fix-code-comment.patch | 578 bytes | alexpott |
#2 | 1-2-interdiff.txt | 1.17 KB | alexpott |
#2 | 1739900-2.drupal8.config.rename.patch | 6.34 KB | alexpott |
#1 | 1739900.drupal8.config.rename.patch | 5.44 KB | alexpott |
Comments
Comment #1
alexpottPatch
Comment #2
alexpottAdditional tests to confirm errors throw when renaming a config object that (a) doesn't exist and (b) to one that already exists.
Comment #3
swentel CreditAttribution: swentel commentedSolid, did a quick test with the rename issue that came up in the field cmi conversion and works fine!
Comment #4
sunI reviewed this as well, looks good to go :)
Comment #5
catchLooks good. Committed/pushed to 8.x.
Comment #6
tstoecklerThat's a copy paste error for the function documentation.
Marking needs work for that.
Also, why does the NullStorage not allow renaming? It seems that wouldn't hurt anything, right?
Comment #7
alexpott@tstoeckler Good catch... will post a follow up... NullStorage has to implement the rename() method because it implements StorageInterface
Comment #8
alexpottDone... since this is just a a simple code comment fix marking as RTBC
Comment #9
tstoecklerRight, I get that. But NullStorage::rename returns FALSE, so that in Config::rename $this->name does not get updated. What I was trying to say was that NullStorage::rename might as well return TRUE. I'll open a new issue for that, though, if it bothers me enough. :-)
Agree with RTBC.
Comment #10
alexpottIt returns false because it is a null object and therefore does not exist so you can't rename it... that's why delete does the same thing :)
Comment #11
catchCommitted/pushed the follow-up.
Comment #12.0
(not verified) CreditAttribution: commentedFixing tag