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.
Objective
-
#2190723: Add a KeyValueStore\FileStorage to replace e.g. ConfigStorage discovered the need for renaming a key in a key/value store.
-
Such a method can be easily supported by any key/value store — worst case implementation is to (1) get the value of the old key, (2) set the new key, and (3) delete the old key.
Proposed solution
-
Add a new
rename()
method toKeyValueStoreInterface
.
Comment | File | Size | Author |
---|---|---|---|
#1 | kv.rename.1.patch | 3.63 KB | sun |
Comments
Comment #1
sunSimple enough.
Comment #3
sun1: kv.rename.1.patch queued for re-testing.
Comment #4
lhangea CreditAttribution: lhangea commentedReviewed. It looks good to me.
Comment #5
sun1: kv.rename.1.patch queued for re-testing.
Comment #7
sun1: kv.rename.1.patch queued for re-testing.
Comment #8
sun#2216459: Add a KeyValueStoreInterface::has() method has landed — let's also move forward here?
Comment #9
dawehnerThis just feels to be perfect. Just ensured that the patch still applies.
Comment #10
webchickCommitted and pushed to 8.x. Thanks!
Comment #13
chx CreditAttribution: chx commentedLet this stand here for the archives: separating this from the real parent issue was probably not a bad idea. But misrepresenting which issue this was originally coded in (not to mention denying credit to the original author) and then shoveling this into KeyValueStore without even mentioning originally this had a separate interface is just another example of the insidiousness from sun that I feel needs to laid bare.