Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0
-
Fix Version/s: 4.3.0
-
Component/s: None
-
Labels:None
Description
When API is used to add or remove option values the relevant pseudoconstants need to be refreshed.
I have added a test on the optionValue class that tests this.
Note that this fix might be seen as a step in the right direction (esp as it is tested) but ideally the flushing would take place at the BAO level & the efforts to flush caching on the OptionValue class would not require such a hacky approach. Probably paymentInstrument pseudoconstant should have the 'only active' flag set too.
totten - constant.get might be the argument for having an api.spec value that allows 'soft options' to be set in metadata? As it seems worth declaring them but they probably won't be up-to-date @ all times?
colemanw - I made the 'class' param on constant.get optional - although until tests are 100% I wouldn't be prepared to remove any of the now-unrequired code in getoptions & constant.get