Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Configuration] Fix saving of values when no previous value present (#…
…7507) When there is a value in ConfigSettings but not Config, the value does not get saved to the database but silently discarded. This is caused by the save logic assuming that the ID always exists to update. However, other logic in the configuration saving deletes from the Config table if the value is "". This means that once a config option is set to the empty string it can never be saved again. (This can also happen for new ConfigSettings.) Since the name used for the text field in the HTML is the Config table ID (which doesn't exist) and not the ConfigSetting ID to support ConfigSetting options that allow multiple entries, the name of the ID is "0" in the form and can not be converted to a ConfigSetting to change the statement from an update to an insertOnDuplicateUpdate. AllowMultiple settings, on the other hand use "add-ConfigSettingID" or "remove-ConfigSettingID" as their name. This modifies the template to use add-ConfigSettingID when the ConfigID is "0" in order to have it inserted if it does not exist, regardless of the AllowMultiple setting for the ConfigSetting.
- Loading branch information