From e4edc736f497948c40315a2139c84b7b86ebf019 Mon Sep 17 00:00:00 2001 From: Dmitriy Tanzirev Date: Thu, 6 Apr 2023 02:01:39 +0700 Subject: [PATCH 1/2] Bugfix - "Infinite list loading" in trash manager What is he doing? Fixes the "infinite list loading" error. Where did this error come from? https://github.com/modxcms/revolution/pull/16228 This change causes an error when starting the processor "resource/trash/getlist". How to test Option 1: Delete the document and go to the trash. Then clean it. There will be an "infinite loading" of the list due to an error. Option 2: Go to the shopping cart and click on the "Update list" icon. There will be an "infinite loading" of the list due to an error. Decision It is necessary to return the sorting so that the xPDOQuery object is returned --- core/model/modx/processors/resource/trash/getlist.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/modx/processors/resource/trash/getlist.class.php b/core/model/modx/processors/resource/trash/getlist.class.php index 16eca1c1e82..c428d2046d7 100644 --- a/core/model/modx/processors/resource/trash/getlist.class.php +++ b/core/model/modx/processors/resource/trash/getlist.class.php @@ -55,7 +55,7 @@ public function prepareQueryBeforeCount(xPDOQuery $c) if ($deleted = $this->getDeleted()) { $c->where(['modResource.id:IN' => $deleted]); } else { - return; + $c->where(['modResource.id' => 0]); } if (!empty($query)) { From 7923acae784524261db2ac184357c2abd8ecfff8 Mon Sep 17 00:00:00 2001 From: Dmitriy Tanzirev Date: Fri, 6 Oct 2023 23:11:15 +0500 Subject: [PATCH 2/2] Update getlist.class.php --- core/model/modx/processors/resource/trash/getlist.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/model/modx/processors/resource/trash/getlist.class.php b/core/model/modx/processors/resource/trash/getlist.class.php index c428d2046d7..0958d57716b 100644 --- a/core/model/modx/processors/resource/trash/getlist.class.php +++ b/core/model/modx/processors/resource/trash/getlist.class.php @@ -56,6 +56,7 @@ public function prepareQueryBeforeCount(xPDOQuery $c) $c->where(['modResource.id:IN' => $deleted]); } else { $c->where(['modResource.id' => 0]); + return $c; } if (!empty($query)) {