Objective

  1. #2190723: Add a KeyValueStore\FileStorage to replace e.g. ConfigStorage discovered the need for renaming a key in a key/value store.

  2. 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

  1. Add a new rename() method to KeyValueStoreInterface.

CommentFileSizeAuthor
#1 kv.rename.1.patch3.63 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Status: Active » Needs review
FileSize
3.63 KB

Simple enough.

Status: Needs review » Needs work

The last submitted patch, 1: kv.rename.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

1: kv.rename.1.patch queued for re-testing.

lhangea’s picture

Reviewed. It looks good to me.

sun’s picture

1: kv.rename.1.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1: kv.rename.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

1: kv.rename.1.patch queued for re-testing.

sun’s picture

#2216459: Add a KeyValueStoreInterface::has() method has landed — let's also move forward here?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This just feels to be perfect. Just ensured that the patch still applies.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • Commit add1e1a on 8.x by webchick:
    Issue #2216579 by sun: Add a KeyValueStoreInterface::rename() method.
    

Status: Fixed » Closed (fixed)

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

chx’s picture

Let 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.