From ac256a664aa490665d37705439807ab6d62a7e3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 4 Dec 2020 00:36:52 +0100 Subject: [PATCH] Continued: - next() needs to increase current position and then check if it is still valid MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../classes/database/result/class_CachedDatabaseResult.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/main/classes/database/result/class_CachedDatabaseResult.php b/framework/main/classes/database/result/class_CachedDatabaseResult.php index 80fe8d05..03af7c2c 100644 --- a/framework/main/classes/database/result/class_CachedDatabaseResult.php +++ b/framework/main/classes/database/result/class_CachedDatabaseResult.php @@ -153,10 +153,12 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul // Default is not valid $nextValid = false; + // Increase position + $this->currentPos++; + // Is the result valid? if ($this->valid()) { - // Next entry found, so count one up and cache it - $this->currentPos++; + // Next entry found, so cache it $this->currentRow = $this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][$this->currentPos]; $nextValid = true; } -- 2.39.5