From 8e302bc77049223a158da9fed48565172bf7b3f9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 24 Sep 2021 10:20:19 +0200 Subject: [PATCH] hasDocuments() doesn't use internal cache anymore --- SeedDMS_Core/Core/inc.ClassFolder.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassFolder.php b/SeedDMS_Core/Core/inc.ClassFolder.php index 551c5a908..e8c7f6af4 100644 --- a/SeedDMS_Core/Core/inc.ClassFolder.php +++ b/SeedDMS_Core/Core/inc.ClassFolder.php @@ -824,11 +824,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * @return int number of documents or false in case of an error */ function hasDocuments() { /* {{{ */ - $db = $this->_dms->getDB(); + $db = $this->_dms->getDB(); + /* Do not use the cache because it may not contain all documents if + * the former call getDocuments() limited the number of documents if (isset($this->_documents)) { - /** @noinspection PhpUndefinedFieldInspection */ return count($this->_documents); - } + } + */ $queryStr = "SELECT count(*) as c FROM `tblDocuments` WHERE `folder` = " . $this->_id; $resArr = $db->getResultArray($queryStr); if (is_bool($resArr) && !$resArr)