From 7a53643ee94f2e2de1004b3cea69579adbd9a3df Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Sat, 17 Dec 2022 21:49:16 +0900
Subject: [PATCH 01/26] =?UTF-8?q?fix:=20=E6=B1=8E=E7=94=A8=E3=83=87?=
=?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E8=87=AA=E4=BD=93?=
=?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F=E5=A0=B4=E5=90=88?=
=?UTF-8?q?=E3=80=81=E9=96=A2=E9=80=A3=E3=81=99=E3=82=8B=E3=83=87=E3=83=BC?=
=?UTF-8?q?=E3=82=BF=E3=81=AF=E5=89=8A=E9=99=A4=E3=81=95=E3=82=8C=E3=82=8B?=
=?UTF-8?q?=E3=81=8C=E3=80=81=E3=83=A1=E3=82=BF=E3=83=87=E3=83=BC=E3=82=BF?=
=?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=BC=E3=82=BF=E3=81=A0=E3=81=91=E5=89=8A?=
=?UTF-8?q?=E9=99=A4=E3=81=95=E3=82=8C=E3=81=9A=E6=AE=8B=E3=81=A3=E3=81=A6?=
=?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=86=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3?=
=?UTF-8?q?=EF=BC=88=E3=82=B4=E3=83=9F=E3=81=8C=E6=AE=8B=E3=82=8B=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Model/Multidatabase.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/Multidatabase.php b/Model/Multidatabase.php
index 5092f95..90729df 100644
--- a/Model/Multidatabase.php
+++ b/Model/Multidatabase.php
@@ -267,7 +267,7 @@ public function deleteMultidatabase($data) {
}
$conditions = [
- $this->MultidatabaseMetadata->alias . '.multidatabase_id' => $data['Multidatabase']['id']
+ $this->MultidatabaseMetadata->alias . '.multidatabase_id' => $multidatabaseIds
];
if (!$this->MultidatabaseMetadata->deleteAll($conditions, false, false)) {
throw new InternalErrorException(__d('net_commons', 'Internal Server Error'));
From bd81d4b2da788d5609f1de4c63859ac8f41bf39a Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Fri, 24 Feb 2023 14:59:13 +0900
Subject: [PATCH 02/26] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?=
=?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/tests.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 9501566..7cfa881 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -44,6 +44,7 @@ jobs:
MYSQL_VERSION: ${{ matrix.mysql }}
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cakephp_test
+ COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
From b7241054d39d2a9e0be1655e19179f8c502ab0cc Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Sun, 26 Feb 2023 03:20:29 +0900
Subject: [PATCH 03/26] change: Version number to 3.3.6
---
VERSION.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION.txt b/VERSION.txt
index fa7adc7..9c25013 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-3.3.5
+3.3.6
From b851eaea61ba0344204d13de51c2aec75a923cd2 Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Fri, 16 Jun 2023 08:20:43 +0900
Subject: [PATCH 04/26] fix: escape
---
View/Helper/MultidatabaseContentViewElementHelper.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/View/Helper/MultidatabaseContentViewElementHelper.php b/View/Helper/MultidatabaseContentViewElementHelper.php
index 5871e09..007b727 100644
--- a/View/Helper/MultidatabaseContentViewElementHelper.php
+++ b/View/Helper/MultidatabaseContentViewElementHelper.php
@@ -161,7 +161,7 @@ private function __renderViewElementFile($content, $colNo, $showCounter = 0) {
$result .= '';
// 表示が全てダウンロードとなる。ファイル名を表示する
//$result .= __d('multidatabases', 'Download');
- $result .= $fileInfo['UploadFile']['original_name'];
+ $result .= h($fileInfo['UploadFile']['original_name']);
$result .= '';
} else {
$result = $this->__renderViewElementFileReqAuth($content, $colNo, $fileInfo);
From 3c3623d350cf995cf7d92b51ae2d5d26f3b916e1 Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Fri, 16 Jun 2023 08:56:59 +0900
Subject: [PATCH 05/26] =?UTF-8?q?test:=20github=20actions=E3=82=A8?=
=?UTF-8?q?=E3=83=A9=E3=83=BC=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/tests.yml | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 7cfa881..bfe7e70 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -15,7 +15,7 @@ name: tests
jobs:
setup:
name: setup
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- name: Slack Notification on Start
uses: rtCamp/action-slack-notify@v2.2.0
@@ -28,7 +28,7 @@ jobs:
tests:
name: tests
needs: setup
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.1', '7.2', '7.3', '7.4' ]
@@ -92,46 +92,54 @@ jobs:
docker-compose exec -T nc3app bash /opt/scripts/app-build.sh
- name: phpcs (PHP CodeSniffer)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh
- name: phpmd (PHP Mess Detector)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh
- name: phpcpd (PHP Copy/Paste Detector)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh
- name: gjslint (JavaScript Style Check)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh
- name: phpdoc (PHP Documentor)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh
- name: phpunit (PHP UnitTest)
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh
sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build
- - name: push coveralls
- env:
- COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- COVERALLS_FLAG_NAME: ${{ matrix.php }}
- run: |
- cd ${NC3_BUILD_DIR}
- ls -la ${NC3_BUILD_DIR}
- vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
+# - name: push coveralls
+# if: success()
+# env:
+# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+# COVERALLS_FLAG_NAME: ${{ matrix.php }}
+# run: |
+# cd ${NC3_BUILD_DIR}
+# ls -la ${NC3_BUILD_DIR}
+# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: docker-compose remove
+ if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose rm -f
@@ -148,7 +156,7 @@ jobs:
teardown:
name: teardown
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
needs: tests
steps:
# テスト成功時はこちらのステップが実行される
From 2b0ed5e99b3745692b4b9d65ab22c5c6a9207dad Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Thu, 5 Oct 2023 19:19:28 +0900
Subject: [PATCH 06/26] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/tests.yml | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index bfe7e70..6da4321 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -3,12 +3,10 @@ on:
branches:
- main
- master
- - availability
pull_request:
branches:
- main
- master
- - availability
name: tests
@@ -19,6 +17,7 @@ jobs:
steps:
- name: Slack Notification on Start
uses: rtCamp/action-slack-notify@v2.2.0
+ if: env.SLACK_WEBHOOK != ''
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
@@ -128,15 +127,14 @@ jobs:
docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh
sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build
-# - name: push coveralls
-# if: success()
-# env:
-# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-# COVERALLS_FLAG_NAME: ${{ matrix.php }}
-# run: |
-# cd ${NC3_BUILD_DIR}
-# ls -la ${NC3_BUILD_DIR}
-# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
+# - name: push coveralls
+# env:
+# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+# COVERALLS_FLAG_NAME: ${{ matrix.php }}
+# run: |
+# cd ${NC3_BUILD_DIR}
+# ls -la ${NC3_BUILD_DIR}
+# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: docker-compose remove
if: always()
@@ -147,7 +145,7 @@ jobs:
# テスト失敗時はこちらのステップが実行される
- name: Slack Notification on Failure
uses: rtCamp/action-slack-notify@v2.2.0
- if: failure()
+ if: env.SLACK_WEBHOOK != '' && failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
@@ -161,8 +159,8 @@ jobs:
steps:
# テスト成功時はこちらのステップが実行される
- name: Slack Notification on Success
- if: success()
uses: rtCamp/action-slack-notify@v2.2.0
+ if: env.SLACK_WEBHOOK != '' && success()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
From aadf2f998c0e41164a3d85fa5086f3dfc15fd990 Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Mon, 9 Oct 2023 20:37:55 +0900
Subject: [PATCH 07/26] change: Version number to 3.3.7
---
VERSION.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION.txt b/VERSION.txt
index 9c25013..86fb650 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-3.3.6
+3.3.7
From 7a3d6b0c20059cc27e6c2021ad72aa0e59b81177 Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Mon, 31 Mar 2025 13:45:36 +0900
Subject: [PATCH 08/26] =?UTF-8?q?fix:2=E3=81=A4=E4=BB=A5=E4=B8=8A=E3=81=AE?=
=?UTF-8?q?=E9=81=B8=E6=8A=9E=E5=BC=8F=EF=BC=88=E8=A4=87=E6=95=B0=EF=BC=89?=
=?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=81=A7=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF?=
=?UTF-8?q?=E3=81=8C=E8=A1=8C=E3=81=88=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Model/MultidatabaseContentSearch.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/MultidatabaseContentSearch.php b/Model/MultidatabaseContentSearch.php
index f809cb7..7cfc2a7 100644
--- a/Model/MultidatabaseContentSearch.php
+++ b/Model/MultidatabaseContentSearch.php
@@ -133,7 +133,7 @@ public function getCondSelect($values = []) {
);
break;
case 'checkbox':
- $result += $this->MultidatabaseContentSearchCond->getCondSelCheck(
+ $result[] = $this->MultidatabaseContentSearchCond->getCondSelCheck(
$metadata['selections'], $values, $valueKey
);
break;
From c30aa87b45df29c14b11816680e6d8ae48029e38 Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Mon, 31 Mar 2025 13:46:17 +0900
Subject: [PATCH 09/26] =?UTF-8?q?fix:=E4=BD=9C=E6=88=90=E6=97=A5=E6=99=82?=
=?UTF-8?q?=E3=81=AE=E6=A4=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E3=82=92=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Model/MultidatabaseContentSearchCond.php | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/Model/MultidatabaseContentSearchCond.php b/Model/MultidatabaseContentSearchCond.php
index 7ea8dac..cf2dff4 100644
--- a/Model/MultidatabaseContentSearchCond.php
+++ b/Model/MultidatabaseContentSearchCond.php
@@ -57,20 +57,28 @@ public function getCondSelVal($query) {
*/
public function getCondStartEndDt($query) {
$conditions = [];
+
+ //サーバタイムゾーンの日時に変換
+ $date = new DateTime($query['start_dt']['value']);
+ $createdStart = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));
+ $date = new DateTime($query['end_dt']['value']);
+ $date->modify('+59 second');
+ $createdEnd = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));
+
if (
!empty($query['start_dt']['value']) &&
!empty($query['end_dt']['value'])
) {
$conditions['MultidatabaseContent.created between ? and ?'] = [
- $query['start_dt']['value'],
- $query['end_dt']['value']
+ $createdStart,
+ $createdEnd
];
} else {
if (!empty($query['start_dt']['value'])) {
- $conditions['MultidatabaseContent.created <='] = $query['start_dt']['value'];
+ $conditions['MultidatabaseContent.created >='] = $createdStart;
}
if (!empty($query['end_dt']['value'])) {
- $conditions['MultidatabaseContent.created >='] = $query['end_dt']['value'];
+ $conditions['MultidatabaseContent.created <='] = $createdEnd;
}
}
From f4c74979c6ebfbf301f7e4865b628666300ffcf7 Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Mon, 31 Mar 2025 13:46:37 +0900
Subject: [PATCH 10/26] =?UTF-8?q?fix:=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF?=
=?UTF-8?q?=E3=81=AE=E3=83=97=E3=83=AB=E3=83=80=E3=82=A6=E3=83=B3=E3=82=92?=
=?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB1?=
=?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E7=9B=AE=E3=82=92=E8=A1=A8=E7=A4=BA?=
=?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
View/Helper/MultidatabaseContentViewHelper.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/View/Helper/MultidatabaseContentViewHelper.php b/View/Helper/MultidatabaseContentViewHelper.php
index a87fb73..6806fe8 100644
--- a/View/Helper/MultidatabaseContentViewHelper.php
+++ b/View/Helper/MultidatabaseContentViewHelper.php
@@ -215,6 +215,7 @@ public function renderGroupItems($metadatas) {
public function dropDownToggleSelect($metadatas, $viewType = 'index') {
$params = $this->_View->Paginator->params;
$named = $params['named'];
+ $named['page'] = 1;
$url = $named;
$result = '';
From f3d92e20e054ec4eb6ce57327cfe21c23939f457 Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Tue, 1 Apr 2025 11:52:32 +0900
Subject: [PATCH 11/26] =?UTF-8?q?fix:=E6=A4=9C=E7=B4=A2=E7=94=BB=E9=9D=A2?=
=?UTF-8?q?=E3=81=8B=E3=82=89=E4=BD=9C=E6=88=90=E8=80=85=E3=81=AE=E9=A0=85?=
=?UTF-8?q?=E7=9B=AE=E3=82=92=E5=89=8A=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
View/MultidatabaseContents/search.ctp | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/View/MultidatabaseContents/search.ctp b/View/MultidatabaseContents/search.ctp
index 6650f9a..333743e 100644
--- a/View/MultidatabaseContents/search.ctp
+++ b/View/MultidatabaseContents/search.ctp
@@ -48,15 +48,6 @@ echo $this->NetCommonsHtml->css([
echo $this->NetCommonsForm->input('type', $options);
?>
-
-
- __d('multidatabases', 'Create user')
- ];
- echo $this->NetCommonsForm->input('create_user', $options);
- ?>
-
From 4fc9eddb181926c22812c9e808637e953601bf4e Mon Sep 17 00:00:00 2001
From: Shohei Nakajima
Date: Wed, 9 Apr 2025 13:27:06 +0900
Subject: [PATCH 12/26] Update VERSION.txt
---
VERSION.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION.txt b/VERSION.txt
index 86fb650..dee3cd5 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-3.3.7
+3.3.7.1
From 5010ab8b4e9e90c51fb51c6e8ba231920f826e08 Mon Sep 17 00:00:00 2001
From: tjs-mochizuki
Date: Fri, 18 Jul 2025 10:39:37 +0900
Subject: [PATCH 13/26] =?UTF-8?q?=E6=B1=8E=E7=94=A8=E3=83=87=E3=83=BC?=
=?UTF-8?q?=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E4=B8=80=E8=A6=A7?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=87=A6=E7=90=86=E3=81=AE=E4=BD=99=E5=88=86?=
=?UTF-8?q?=E3=81=AA=E3=83=87=E3=83=BC=E3=82=BF=E5=8F=96=E5=BE=97=E5=87=A6?=
=?UTF-8?q?=E7=90=86=E3=82=92=E5=89=8A=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MultidatabaseContentsController.php | 6 ++--
Controller/MultidatabasesAppController.php | 30 +++++--------------
Model/MultidatabaseContentSearch.php | 7 +++--
Model/MultidatabaseMetadata.php | 8 ++++-
4 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/Controller/MultidatabaseContentsController.php b/Controller/MultidatabaseContentsController.php
index ec8627a..6e0543d 100644
--- a/Controller/MultidatabaseContentsController.php
+++ b/Controller/MultidatabaseContentsController.php
@@ -130,13 +130,11 @@ public function beforeFilter() {
return false;
}
- $frameSetting = $this->MultidatabaseFrameSetting->getMultidatabaseFrameSetting(true);
- $this->set('multidatabaseFrameSetting', $frameSetting['MultidatabaseFrameSetting']);
-
// ゲストアクセスOKのアクションを設定
$this->Auth->allow('index', 'detail', 'search');
$this->_prepare();
+ $this->set('multidatabaseFrameSetting', $this->_frameSetting['MultidatabaseFrameSetting']);
}
/**
@@ -503,7 +501,7 @@ private function __condSortOrder($sortCol = '') {
*/
private function __condSelect() {
$pagerNamed = $this->Paginator->Controller->params->named;
- return $this->MultidatabaseContentSearch->getCondSelect($pagerNamed);
+ return $this->MultidatabaseContentSearch->getCondSelect($pagerNamed, $this->_metadata);
}
/**
diff --git a/Controller/MultidatabasesAppController.php b/Controller/MultidatabasesAppController.php
index 0b5b790..4eb5eb6 100644
--- a/Controller/MultidatabasesAppController.php
+++ b/Controller/MultidatabasesAppController.php
@@ -72,25 +72,10 @@ class MultidatabasesAppController extends AppController {
* @return void
*/
protected function _prepare() {
- $this->_setupMultidatabaseTitle();
$this->_initMultidatabase(['multidatabaseSetting']);
$this->_loadFrameSetting();
}
-/**
- * ブロック名を汎用DBタイトルとしてセットする
- *
- * @return void
- */
- protected function _setupMultidatabaseTitle() {
- $this->loadModel('Blocks.Block');
- $block = $this->Block->find('first', [
- 'recursive' => 0,
- 'conditions' => ['Block.id' => Current::read('Block.id')],
- ]);
- $this->_multidatabaseTitle = $block['BlocksLanguage']['name'];
- }
-
/**
* 初期設定
*
@@ -103,24 +88,23 @@ protected function _initMultidatabase() {
}
// メタデータを取得
- if (!$metadata = $this->MultidatabaseMetadata->getEditMetadatas(
+ if (!$metadatas = $this->MultidatabaseMetadata->getEditMetadatas(
$multidatabase['Multidatabase']['id'])
) {
return $this->throwBadRequest();
}
- if (!$metadataGroups = $this->MultidatabaseMetadata->getMetadataGroups(
- $multidatabase['Multidatabase']['id'])
- ) {
- return $this->throwBadRequest();
+ foreach ($metadatas as $metadata) {
+ $metadataGroups[$metadata['position']][$metadata['rank']] = $metadata;
}
$this->_multidatabaseTitle = $multidatabase['Multidatabase']['name'];
$this->set('multidatabase', $multidatabase);
- $this->set('multidatabaseMetadata', $metadata);
+ $this->set('multidatabaseMetadata', $metadatas);
$this->set('multidatabaseMetadataGroups', $metadataGroups);
- if (!$multidatabaseSetting = $this->MultidatabaseSetting->getMultidatabaseSetting()) {
+ $multidatabaseSetting['MultidatabaseSetting'] = $multidatabase['MultidatabaseSetting'];
+ if (!$multidatabaseSetting) {
$multidatabaseSetting = $this->MultidatabaseSetting->createBlockSetting();
$multidatabaseSetting['MultidatabaseSetting']['multidatabase_key'] = null;
} else {
@@ -129,7 +113,7 @@ protected function _initMultidatabase() {
}
$this->_multidatabase = $multidatabase;
- $this->_metadata = $metadata;
+ $this->_metadata = $metadatas;
$this->_setting = $multidatabaseSetting;
$this->set('multidatabaseSetting', $multidatabaseSetting['MultidatabaseSetting']);
$this->set('userId', (int)$this->Auth->user('id'));
diff --git a/Model/MultidatabaseContentSearch.php b/Model/MultidatabaseContentSearch.php
index 7cfc2a7..138e1b3 100644
--- a/Model/MultidatabaseContentSearch.php
+++ b/Model/MultidatabaseContentSearch.php
@@ -101,9 +101,10 @@ public function getSearchConds($query = []) {
* 複数選択、単一選択の絞込条件出力
*
* @param array $values 値
+ * @param array $metadatas メタデータ
* @return array
*/
- public function getCondSelect($values = []) {
+ public function getCondSelect($values = [], $metadatas = []) {
$this->loadModels([
'MultidatabaseMetadata' => 'Multidatabases.MultidatabaseMetadata',
'MultidatabaseContentSearchCond' => 'Multidatabases.MultidatabaseContentSearchCond',
@@ -113,7 +114,9 @@ public function getCondSelect($values = []) {
return [];
}
- $metadatas = $this->MultidatabaseMetadata->getEditMetadatas();
+ if (empty($metadatas)) {
+ $metadatas = $this->MultidatabaseMetadata->getEditMetadatas();
+ }
$result = [];
$valueKey = null;
diff --git a/Model/MultidatabaseMetadata.php b/Model/MultidatabaseMetadata.php
index e1f4a0b..d2f9260 100644
--- a/Model/MultidatabaseMetadata.php
+++ b/Model/MultidatabaseMetadata.php
@@ -222,7 +222,13 @@ public function getMetadatasColNo($multidatabaseId = 0) {
*/
public function getMetadatas($multidatabaseId = 0, $extraConditions = []) {
if (empty($multidatabaseId)) {
- if (! $multidatabase = $this->Multidatabase->getMultidatabase()) {
+ $multidatabase = $this->Multidatabase->find('first', [
+ 'recursive' => 0,
+ 'fields' => 'Multidatabase.id',
+ 'conditions' => $this->Multidatabase->getBlockConditionById(),
+ ]);
+
+ if (!$multidatabase) {
return false;
}
$multidatabaseId = $multidatabase['Multidatabase']['id'];
From 8d43ee01265b8599c5c5459f1ca4c4992f79a89a Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Mon, 4 Aug 2025 09:37:04 +0900
Subject: [PATCH 14/26] =?UTF-8?q?callback=E3=82=92=E5=AE=9F=E8=A1=8C?=
=?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Model/MultidatabaseFrameSetting.php | 1 +
Model/MultidatabaseMetadata.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/Model/MultidatabaseFrameSetting.php b/Model/MultidatabaseFrameSetting.php
index 36d42dd..a2229c5 100644
--- a/Model/MultidatabaseFrameSetting.php
+++ b/Model/MultidatabaseFrameSetting.php
@@ -80,6 +80,7 @@ public function getMultidatabaseFrameSetting() {
$frameSetting = $this->find('first', [
'recursive' => -1,
'conditions' => $conditions,
+ 'callbacks' => false,
]
);
diff --git a/Model/MultidatabaseMetadata.php b/Model/MultidatabaseMetadata.php
index d2f9260..83034b0 100644
--- a/Model/MultidatabaseMetadata.php
+++ b/Model/MultidatabaseMetadata.php
@@ -226,6 +226,7 @@ public function getMetadatas($multidatabaseId = 0, $extraConditions = []) {
'recursive' => 0,
'fields' => 'Multidatabase.id',
'conditions' => $this->Multidatabase->getBlockConditionById(),
+ 'callbacks' => false,
]);
if (!$multidatabase) {
From 8178aa1013c0fa87165d8330d2f0c1de62f96dd4 Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Mon, 4 Aug 2025 13:47:00 +0900
Subject: [PATCH 15/26] =?UTF-8?q?=E4=B8=80=E8=A6=A7=E8=A1=A8=E7=A4=BA?=
=?UTF-8?q?=E6=99=82=E3=81=AB=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E3=82=AB?=
=?UTF-8?q?=E3=83=A9=E3=83=A0=E3=82=92=E5=88=B6=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MultidatabaseContentsController.php | 29 ++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/Controller/MultidatabaseContentsController.php b/Controller/MultidatabaseContentsController.php
index 6e0543d..c67edcc 100644
--- a/Controller/MultidatabaseContentsController.php
+++ b/Controller/MultidatabaseContentsController.php
@@ -544,12 +544,39 @@ private function __list($extraConditions = []) {
);
}
+ $field = [
+ 'Block.*',
+ 'Like.*',
+ 'LikesUser.*',
+ 'MultidatabaseContent.id',
+ 'MultidatabaseContent.key',
+ 'MultidatabaseContent.multidatabase_key',
+ 'MultidatabaseContent.multidatabase_id',
+ 'MultidatabaseContent.language_id',
+ 'MultidatabaseContent.block_id',
+ 'MultidatabaseContent.title_icon',
+ 'MultidatabaseContent.status',
+ 'MultidatabaseContent.is_active',
+ 'MultidatabaseContent.is_latest',
+ 'MultidatabaseContent.created_user',
+ 'MultidatabaseContent.created',
+ 'MultidatabaseContent.modified_user',
+ 'MultidatabaseContent.modified',
+ ];
+
+ foreach($this->_metadata as $metadata) {
+ if($metadata['is_visible_list']) {
+ $field[] = 'MultidatabaseContent.' . 'value' . $metadata['col_no'];
+ }
+ }
+
$this->Paginator->settings = array_merge(
$this->Paginator->settings,
[
'conditions' => $conditions,
'limit' => $this->_frameSetting['MultidatabaseFrameSetting']['content_per_page'],
- 'order' => $this->__condSortOrder()
+ 'order' => $this->__condSortOrder(),
+ 'fields' => $field
]
);
From 8fd658cca18e39c5c534f01daa25f0b684eb125a Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Tue, 5 Aug 2025 16:58:44 +0900
Subject: [PATCH 16/26] =?UTF-8?q?phpcs=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?=
=?UTF-8?q?=E5=AF=BE=E5=BF=9C?=
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 c67edcc..c65a707 100644
--- a/Controller/MultidatabaseContentsController.php
+++ b/Controller/MultidatabaseContentsController.php
@@ -564,8 +564,8 @@ private function __list($extraConditions = []) {
'MultidatabaseContent.modified',
];
- foreach($this->_metadata as $metadata) {
- if($metadata['is_visible_list']) {
+ foreach ($this->_metadata as $metadata) {
+ if ($metadata['is_visible_list']) {
$field[] = 'MultidatabaseContent.' . 'value' . $metadata['col_no'];
}
}
From 6960100164f30af1f9626da34eb19235654f6a3e Mon Sep 17 00:00:00 2001
From: "G01\\fj2532ir"
Date: Tue, 19 Aug 2025 14:35:10 +0900
Subject: [PATCH 17/26] =?UTF-8?q?multidatabase=5Fcontents=E3=81=AB?=
=?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF=E3=82=B9=E3=82=92?=
=?UTF-8?q?=E8=BF=BD=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Config/Migration/1753253996_add_index.php | 70 +++++++++++++++++++++++
Config/Schema/schema.php | 4 +-
2 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 Config/Migration/1753253996_add_index.php
diff --git a/Config/Migration/1753253996_add_index.php b/Config/Migration/1753253996_add_index.php
new file mode 100644
index 0000000..caaebf8
--- /dev/null
+++ b/Config/Migration/1753253996_add_index.php
@@ -0,0 +1,70 @@
+
+ * @link http://www.netcommons.org NetCommons Project
+ * @license http://www.netcommons.org/license.txt NetCommons License
+ * @copyright Copyright 2014, NetCommons Project
+ */
+
+/**
+ * AddIndex Migration
+ *
+ * @author Hiroki Mochizuki
+ * @package NetCommons\Multidatabases\Config\Migration
+ *
+ */
+class AddIndex extends CakeMigration {
+
+/**
+ * Migration description
+ *
+ * @var string
+ */
+ public $description = 'add_index';
+
+/**
+ * Actions to be performed
+ *
+ * @var array $migration
+ */
+ public $migration = array(
+ 'up' => array(
+ 'create_field' => array(
+ 'multidatabase_contents' => array(
+ 'indexes' => array(
+ 'key' => array('column' => 'key', 'unique' => 0),
+ 'block_id' => array('column' => 'block_id', 'unique' => 0),
+ ),
+ ),
+ ),
+ ),
+ 'down' => array(
+ 'drop_field' => array(
+ 'multidatabase_contents' => array('indexes' => array('key', 'block_id')),
+ ),
+ ),
+ );
+
+/**
+ * Before migration callback
+ *
+ * @param string $direction Direction of migration process (up or down)
+ * @return bool Should process continue
+ */
+ public function before($direction) {
+ return true;
+ }
+
+/**
+ * After migration callback
+ *
+ * @param string $direction Direction of migration process (up or down)
+ * @return bool Should process continue
+ */
+ public function after($direction) {
+ return true;
+ }
+}
diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php
index a67f3c0..f17577d 100644
--- a/Config/Schema/schema.php
+++ b/Config/Schema/schema.php
@@ -161,7 +161,9 @@ public function after($event = array()) {
'modified_user' => array('type' => 'integer', 'null' => true, 'default' => '0', 'unsigned' => false, 'comment' => '更新者'),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'),
'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ 'key' => array('column' => 'key', 'unique' => 0),
+ 'block_id' => array('column' => 'block_id', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
From 0e72412d692cd78419221ef13070a2e1ca6c1218 Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Tue, 30 Sep 2025 00:14:57 +0900
Subject: [PATCH 18/26] =?UTF-8?q?fix:=20=E6=B1=8E=E7=94=A8=E3=83=87?=
=?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E7=B7=A8?=
=?UTF-8?q?=E9=9B=86=E7=94=BB=E9=9D=A2=E3=81=A7=E3=80=8C=E7=99=BB=E9=8C=B2?=
=?UTF-8?q?=E6=B8=88=E3=81=BF=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?=
=?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=80=8D=E3=81=AB?=
=?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E4=BB=98=E3=81=91?=
=?UTF-8?q?=E3=81=A6=E3=82=82=E6=B7=BB=E4=BB=98=E3=83=95=E3=82=A1=E3=82=A4?=
=?UTF-8?q?=E3=83=AB=E3=81=8C=E5=89=8A=E9=99=A4=E3=81=95=E3=82=8C=E3=81=AA?=
=?UTF-8?q?=E3=81=84=20https://github.com/NetCommons3/NetCommons3/issues/1?=
=?UTF-8?q?728?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Model/MultidatabaseContent.php | 18 +++++++++++++----
Model/MultidatabaseContentFile.php | 32 ++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/Model/MultidatabaseContent.php b/Model/MultidatabaseContent.php
index 1275cd2..eadd57f 100644
--- a/Model/MultidatabaseContent.php
+++ b/Model/MultidatabaseContent.php
@@ -288,6 +288,14 @@ public function saveContent($data, $isUpdate) {
}
$data = $this->data;
+ // $this->dataには、クレンジングされたデータが保持されており、添付ファイルの削除フラグが消されてしまっている。
+ // 後続の処理で、添付ファイルを削除する際に、`$data['value5__attach_del'] = 'on'`がないと削除してくれないため、
+ // $dataを引数$dataにある値を戻す。
+ foreach ($deleteFiles as $colNo) {
+ $delColumn = 'value' . $colNo . '_attach';
+ $data[$delColumn . '_del'] = 'on';
+ }
+
$result = $this->MultidatabaseContentEdit->makeSaveData($data, $metadatas, $isUpdate);
return $this->__saveContent($result);
@@ -365,7 +373,7 @@ public function deleteContentByKey($key) {
$this->deleteCommentsByContentKey($key);
// 添付ファイルの削除
- if (! $this->MultidatabaseContentFile->removeFileByContentKey($key)) {
+ if (! $this->MultidatabaseContentFile->removeFilesByContentKey($key)) {
throw new InternalErrorException(__d('net_commons', 'Internal Server Error'));
}
@@ -470,14 +478,16 @@ private function __saveContent($data) {
$attachPasswords
);
- $this->commit();
-
// ファイルを削除する
if (! empty($removeAttachFields)) {
$this->MultidatabaseContentFile->removeAttachFile(
- $removeAttachFields, $data['MultidatabaseContent']['key']);
+ $removeAttachFields,
+ $data['MultidatabaseContent']['key']
+ );
}
+ $this->commit();
+
} catch (Exception $e) {
$this->rollback($e);
}
diff --git a/Model/MultidatabaseContentFile.php b/Model/MultidatabaseContentFile.php
index cf06d2c..b39a71e 100644
--- a/Model/MultidatabaseContentFile.php
+++ b/Model/MultidatabaseContentFile.php
@@ -241,6 +241,38 @@ public function removeFileByContentKey($key, $fieldName = '') {
return $this->__removeFile($fileInfo, $fieldName);
}
+/**
+ * Remove File(s)
+ * ファイルを削除する(コンテンツKeyより)
+ *
+ * @param string $contentKey コンテンツKey
+ * @return bool
+ */
+ public function removeFilesByContentKey($contentKey) {
+ $UploadFile = ClassRegistry::init('Files.UploadFile');
+ $pluginKey = 'multidatabases';
+
+ $options = [
+ 'recursive' => -1,
+ 'fields' => [
+ 'UploadFile.id',
+ ],
+ 'conditions' => [
+ 'UploadFile.plugin_key' => $pluginKey,
+ 'UploadFile.content_key' => $contentKey,
+ ],
+ 'callbacks' => false,
+ ];
+
+ $files = $UploadFile->find('all', $options);
+
+ foreach ($files as $file) {
+ $UploadFile->deleteUploadFile($file['UploadFile']['id']);
+ }
+
+ return true;
+ }
+
/**
* RemoveFile(s) Base
* ファイルを削除する
From 49cd0503c71caea8862e0e17c81b3d19861c41a0 Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Tue, 30 Sep 2025 00:25:24 +0900
Subject: [PATCH 19/26] =?UTF-8?q?ci:=20test=E3=82=B1=E3=83=BC=E3=82=B9?=
=?UTF-8?q?=E3=82=92php7.4=E3=81=AE=E3=81=BF=E3=81=AB=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/tests.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 6da4321..f46fc05 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -30,8 +30,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- php: [ '7.1', '7.2', '7.3', '7.4' ]
- mysql: [ '5.7', '8.0' ]
+ php: [ '7.4' ]
+ mysql: [ '8.0' ]
env:
NC3_BUILD_DIR: "/opt/nc3"
From de28ad763c14e75cb589fec95d5cb15b2dbeb454 Mon Sep 17 00:00:00 2001
From: tmx-researchmap-team
Date: Fri, 6 Feb 2026 14:38:45 +0900
Subject: [PATCH 20/26] =?UTF-8?q?add:=20=E3=83=91=E3=83=95=E3=82=A9?=
=?UTF-8?q?=E3=83=BC=E3=83=9E=E3=83=B3=E3=82=B9=E6=94=B9=E5=96=84=E3=81=AB?=
=?UTF-8?q?=E4=BC=B4=E3=81=86=E3=82=A4=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF?=
=?UTF-8?q?=E3=82=B9=E8=BF=BD=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Config/Migration/1769652195_add_index.php | 65 +++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 Config/Migration/1769652195_add_index.php
diff --git a/Config/Migration/1769652195_add_index.php b/Config/Migration/1769652195_add_index.php
new file mode 100644
index 0000000..545f61e
--- /dev/null
+++ b/Config/Migration/1769652195_add_index.php
@@ -0,0 +1,65 @@
+ array(
+ 'create_field' => array(
+ 'multidatabase_contents' => array(
+ 'indexes' => array(
+ 'idx1_p_multidatabase_contents' => array('column' => array('block_id', 'language_id', 'is_active'), 'unique' => 0),
+ 'idx2_p_multidatabase_contents' => array('column' => array('`key`(191)'), 'unique' => 0),
+ ),
+ ),
+ 'multidatabase_metadatas' => array(
+ 'indexes' => array(
+ 'idx1_p_multidatabase_metadatas' => array('column' => array('multidatabase_id', 'is_title'), 'unique' => 0),
+ 'idx2_p_multidatabase_metadatas' => array('column' => array('multidatabase_id', 'position', '`rank`'), 'unique' => 0),
+ ),
+ ),
+ ),
+ ),
+ 'down' => array(
+ 'drop_field' => array(
+ 'multidatabase_contents' => array('indexes' => array('idx1_p_multidatabase_contents', 'idx2_p_multidatabase_contents')),
+ 'multidatabase_metadatas' => array('indexes' => array('idx1_p_multidatabase_metadatas', 'idx2_p_multidatabase_metadatas')),
+ ),
+ ),
+ );
+
+/**
+ * Before migration callback
+ *
+ * @param string $direction Direction of migration process (up or down)
+ * @return bool Should process continue
+ */
+ public function before($direction) {
+ return true;
+ }
+
+/**
+ * After migration callback
+ *
+ * @param string $direction Direction of migration process (up or down)
+ * @return bool Should process continue
+ */
+ public function after($direction) {
+ return true;
+ }
+}
From f16542dc544cd9b42288ee5832d6b8938698d957 Mon Sep 17 00:00:00 2001
From: "TMX\\kazuno"
Date: Mon, 16 Feb 2026 17:41:12 +0900
Subject: [PATCH 21/26] =?UTF-8?q?change:=20=E3=83=91=E3=83=95=E3=82=A9?=
=?UTF-8?q?=E3=83=BC=E3=83=9E=E3=83=B3=E3=82=B9=E6=94=B9=E5=96=84=E3=81=AB?=
=?UTF-8?q?=E4=BC=B4=E3=81=86=E3=82=A4=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF?=
=?UTF-8?q?=E3=82=B9=E8=BF=BD=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Config/Migration/1769652195_add_index.php | 7 -------
Config/Schema/schema.php | 4 +++-
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/Config/Migration/1769652195_add_index.php b/Config/Migration/1769652195_add_index.php
index 545f61e..edba5b9 100644
--- a/Config/Migration/1769652195_add_index.php
+++ b/Config/Migration/1769652195_add_index.php
@@ -21,12 +21,6 @@ class AddIndex1769652195 extends CakeMigration {
public $migration = array(
'up' => array(
'create_field' => array(
- 'multidatabase_contents' => array(
- 'indexes' => array(
- 'idx1_p_multidatabase_contents' => array('column' => array('block_id', 'language_id', 'is_active'), 'unique' => 0),
- 'idx2_p_multidatabase_contents' => array('column' => array('`key`(191)'), 'unique' => 0),
- ),
- ),
'multidatabase_metadatas' => array(
'indexes' => array(
'idx1_p_multidatabase_metadatas' => array('column' => array('multidatabase_id', 'is_title'), 'unique' => 0),
@@ -37,7 +31,6 @@ class AddIndex1769652195 extends CakeMigration {
),
'down' => array(
'drop_field' => array(
- 'multidatabase_contents' => array('indexes' => array('idx1_p_multidatabase_contents', 'idx2_p_multidatabase_contents')),
'multidatabase_metadatas' => array('indexes' => array('idx1_p_multidatabase_metadatas', 'idx2_p_multidatabase_metadatas')),
),
),
diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php
index f17577d..5b83cff 100644
--- a/Config/Schema/schema.php
+++ b/Config/Schema/schema.php
@@ -214,7 +214,9 @@ public function after($event = array()) {
'modified_user' => array('type' => 'integer', 'null' => true, 'default' => '0', 'unsigned' => false, 'comment' => '更新者'),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'),
'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ 'idx1_p_multidatabase_metadatas' => array('column' => array('multidatabase_id', 'is_title'), 'unique' => 0),
+ 'idx2_p_multidatabase_metadatas' => array('column' => array('multidatabase_id', 'position', '`rank`'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
From 163633ee5121e6db1456967041295b56707854db Mon Sep 17 00:00:00 2001
From: s-nakajima
Date: Fri, 20 Feb 2026 13:24:12 +0900
Subject: [PATCH 22/26] =?UTF-8?q?ci:=20phpdoc=E3=82=A8=E3=83=A9=E3=83=BC?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Config/Migration/1769652195_add_index.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Config/Migration/1769652195_add_index.php b/Config/Migration/1769652195_add_index.php
index edba5b9..7ca1814 100644
--- a/Config/Migration/1769652195_add_index.php
+++ b/Config/Migration/1769652195_add_index.php
@@ -1,8 +1,12 @@
Date: Tue, 24 Mar 2026 10:46:45 +0900
Subject: [PATCH 23/26] =?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 24/26] =?UTF-8?q?fix:=20=E3=83=87=E3=83=BC=E3=82=BF?=
=?UTF-8?q?=E5=8F=96=E5=BE=97=E6=99=82=E3=81=AB=E7=AC=AC=EF=BC=92=EF=BC=8C?=
=?UTF-8?q?=EF=BC=93=E3=82=BD=E3=83=BC=E3=83=88=E3=82=AD=E3=83=BC=E3=82=92?=
=?UTF-8?q?=E3=82=BB=E3=83=83=E3=83=88=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?=
=?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?=
=?UTF-8?q?tCommons3/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 25/26] =?UTF-8?q?fix:=20=E3=82=B3=E3=83=B3=E3=83=86?=
=?UTF-8?q?=E3=83=B3=E3=83=84=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F?=
=?UTF-8?q?=E9=9A=9B=E3=81=AB=E3=80=81topics=E3=81=AE=E3=83=AC=E3=82=B3?=
=?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?=
=?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https://github.?=
=?UTF-8?q?com/NetCommons3/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 26/26] =?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'],
]
);