From 8d56fb8fbef24496fc4a8d6cbfeeba634789a317 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Fri, 22 Feb 2019 23:57:04 +0100 Subject: [PATCH] bugfix marking of db-values --- src/Core/Config/Adapter/JITPConfigAdapter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Core/Config/Adapter/JITPConfigAdapter.php b/src/Core/Config/Adapter/JITPConfigAdapter.php index e320104e73..5c1627eba0 100644 --- a/src/Core/Config/Adapter/JITPConfigAdapter.php +++ b/src/Core/Config/Adapter/JITPConfigAdapter.php @@ -49,15 +49,19 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap /** * {@inheritdoc} + * + * @param bool $mark if true, mark the selection of the current cat/key pair */ - public function get($uid, $cat, $key) + public function get($uid, $cat, $key, $mark = true) { if (!$this->isConnected()) { return null; } // The value was in the db, so don't check it again (unless you have to) - $this->in_db[$uid][$cat][$key] = true; + if ($mark) { + $this->in_db[$uid][$cat][$key] = true; + } $pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $key]); if (DBA::isResult($pconfig)) { @@ -86,7 +90,7 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap // The exception are array values. $dbvalue = (!is_array($value) ? (string)$value : $value); - $stored = $this->get($uid, $cat, $key); + $stored = $this->get($uid, $cat, $key, false); if (!isset($this->in_db[$uid])) { $this->in_db[$uid] = []; -- 2.39.5