Skip to content
Snippets Groups Projects
Commit 50929751 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #2147 from nextcloud/dont-update-same-value

Don't update value if it is already set to the same value
parents 4035d608 577a8a73
No related branches found
No related tags found
No related merge requests found
......@@ -215,11 +215,13 @@ class AllConfig implements \OCP\IConfig {
// TODO - FIXME
$this->fixDIInit();
if (isset($this->userCache[$userId][$appName][$key])) {
if ($this->userCache[$userId][$appName][$key] === (string)$value) {
return;
} else if ($preCondition !== null && $this->userCache[$userId][$appName][$key] !== (string)$preCondition) {
$prevValue = $this->getUserValue($userId, $appName, $key, null);
if ($prevValue !== null) {
if ($prevValue === (string)$value) {
return;
} else if ($preCondition !== null && $prevValue !== (string)$preCondition) {
throw new PreConditionNotMetException();
} else {
$qb = $this->connection->getQueryBuilder();
$qb->update('preferences')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment