Add empty config value for scope based config setting (#5551)

This commit is contained in:
sureshanaparti 2021-10-06 03:19:33 +05:30 committed by GitHub
parent e198edfaf8
commit e4beb1f955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -826,12 +826,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
return _configDao.findByName(name);
}
value = value.trim();
if (value.isEmpty() || value.equals("null")) {
value = null;
}
String scope = null;
Long id = null;
int paramCountCheck = 0;
@ -871,6 +865,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
throw new InvalidParameterValueException("cannot handle multiple IDs, provide only one ID corresponding to the scope");
}
value = value.trim();
if (value.isEmpty() || value.equals("null")) {
value = (id == null) ? null : "";
}
final String updatedValue = updateConfiguration(userId, name, catergory, value, scope, id);
if (value == null && updatedValue == null || updatedValue.equalsIgnoreCase(value)) {
return _configDao.findByName(name);