I'm suprised that it is so hard to update an option value in a certain group using our API.
I have been writing scripts as follows:
- get option group id where option group name = X (save as OptionGroupIDX)
- get option value id where option value name = Y and option group id = OptionGroupIDX =(save as OptionValueIDY)
- update OptionValueIDY title to Z
I'd like to be able to write scripts that look more like:
- update the option value X in option group Y to value Z
The real world shell script I'm using at the minute is as follows:
OPTION_GROUP_ID=`drush cvapi OptionGroup.getvalue return=id name=from_email_address` OPTION_VALUE_ID=`drush cvapi OptionValue.getvalue return=id option_group_id=$OPTION_GROUP_ID` drush cvapi OptionValue.create id=$OPTION_VALUE_ID label='"Fixed" <email@example.com>'
Anyone able to help me get it closer to a one liner? Would be awesome if so because patterns like this seem to come up a fair amount when I'm working with the API. Would chaining help here?