From b7b13ee3dc893a230b36e38a8ad7a1b4b0bd05d7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 24 Mar 2026 10:46:45 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20Notice=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/MultidatabaseContentsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/MultidatabaseContentsController.php b/Controller/MultidatabaseContentsController.php index c65a707..18eee45 100644 --- a/Controller/MultidatabaseContentsController.php +++ b/Controller/MultidatabaseContentsController.php @@ -442,7 +442,7 @@ public function search() { } $searchConds = $this->MultidatabaseContentSearch->getSearchConds($query); - $conditions = $this->__listBase($searchConds['conditions']); + $conditions = $this->__listBase($searchConds ? $searchConds['conditions'] : []); // paginatorへ渡すための条件を取得する $this->Paginator->settings = array_merge( @@ -450,7 +450,7 @@ public function search() { [ 'conditions' => $conditions, 'limit' => $this->_frameSetting['MultidatabaseFrameSetting']['content_per_page'], - 'order' => $searchConds['order'], + 'order' => $searchConds ? $searchConds['order'] : [], ] ); From 0303877e636a4fe01a94c67c09ef97d63a36ada0 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 24 Mar 2026 10:48:44 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E3=83=87=E3=83=BC=E3=82=BF=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E6=99=82=E3=81=AB=E7=AC=AC=EF=BC=92=EF=BC=8C=EF=BC=93?= =?UTF-8?q?=E3=82=BD=E3=83=BC=E3=83=88=E3=82=AD=E3=83=BC=E3=82=92=E3=82=BB?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1733?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/MultidatabaseContentSearch.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Model/MultidatabaseContentSearch.php b/Model/MultidatabaseContentSearch.php index 138e1b3..1eca98f 100644 --- a/Model/MultidatabaseContentSearch.php +++ b/Model/MultidatabaseContentSearch.php @@ -181,7 +181,11 @@ public function getCondSortOrder($sortCol = '') { $sortColDir = 'desc'; } - $sortOrder = ['MultidatabaseContent.' . $sortCol => $sortColDir]; + $sortOrder = [ + 'MultidatabaseContent.' . $sortCol => $sortColDir, + 'MultidatabaseContent.created' => $sortColDir, + 'MultidatabaseContent.id' => $sortColDir + ]; return $sortOrder; } From 0e734508807269a6a9220429ab6d294f708999ff Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 24 Mar 2026 11:12:55 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3?= =?UTF-8?q?=E3=83=84=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F=E9=9A=9B?= =?UTF-8?q?=E3=81=AB=E3=80=81topics=E3=81=AE=E3=83=AC=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1734?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/MultidatabaseContent.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Model/MultidatabaseContent.php b/Model/MultidatabaseContent.php index eadd57f..d9fdc36 100644 --- a/Model/MultidatabaseContent.php +++ b/Model/MultidatabaseContent.php @@ -381,6 +381,8 @@ public function deleteContentByKey($key) { 'MultidatabaseContent.Key' => $key, ]; + $this->Behaviors->load('Topics.Topics'); + if ($result = $this->deleteAll($conditions, true, true)) { $this->commit(); } else { From 344ce62e2fa4ddec4f61772046aa5017cbb1c803 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 24 Mar 2026 12:33:31 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20phpmd=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/MultidatabaseContentsController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Controller/MultidatabaseContentsController.php b/Controller/MultidatabaseContentsController.php index 18eee45..d67e2c8 100644 --- a/Controller/MultidatabaseContentsController.php +++ b/Controller/MultidatabaseContentsController.php @@ -19,6 +19,7 @@ * * @author Tomoyuki OHNO (Ricksoft Co., Ltd.) * @package NetCommons\Multidatabases\Controller + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class MultidatabaseContentsController extends MultidatabasesAppController { @@ -407,6 +408,7 @@ public function download() { * 検索 * * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function search() { // クエリを取得する @@ -442,7 +444,10 @@ public function search() { } $searchConds = $this->MultidatabaseContentSearch->getSearchConds($query); - $conditions = $this->__listBase($searchConds ? $searchConds['conditions'] : []); + if (!$searchConds) { + $searchConds = ['conditions' => [], 'order' => []]; + } + $conditions = $this->__listBase($searchConds['conditions']); // paginatorへ渡すための条件を取得する $this->Paginator->settings = array_merge( @@ -450,7 +455,7 @@ public function search() { [ 'conditions' => $conditions, 'limit' => $this->_frameSetting['MultidatabaseFrameSetting']['content_per_page'], - 'order' => $searchConds ? $searchConds['order'] : [], + 'order' => $searchConds['order'], ] );