From ca955f1ac64a2ca8edf483f802ed202789f012c4 Mon Sep 17 00:00:00 2001 From: ryuring Date: Tue, 27 Feb 2024 19:10:50 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=AB=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E7=94=BB=E9=9D=A2=E3=81=A7=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E3=81=8C=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=20fix=20#3171?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/Model/Table/PermissionsTable.php | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/baser-core/src/Model/Table/PermissionsTable.php b/plugins/baser-core/src/Model/Table/PermissionsTable.php index d125ebfce1..ed50aec353 100644 --- a/plugins/baser-core/src/Model/Table/PermissionsTable.php +++ b/plugins/baser-core/src/Model/Table/PermissionsTable.php @@ -105,7 +105,6 @@ public function validationDefault(Validator $validator): Validator ->scalar('url') ->maxLength('url', 255, __d('baser_core', '設定URLは255文字以内で入力してください。')) ->notEmptyString('url', __d('baser_core', '設定URLを入力してください。')) - ->requirePresence('url') ->regex('url', '/\A\//', __d('baser_core', '設定URLはスラッシュから始まるURLを入力してください。')) ->add('url', [ 'nameAlphaNumericPlus' => [ From bf0dd9a4f520eb5d13812c1c6c242125be5bf002 Mon Sep 17 00:00:00 2001 From: ryuring Date: Tue, 27 Feb 2024 19:26:17 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=AB=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E7=94=BB=E9=9D=A2=E3=81=A7=E3=80=81url?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A3=E3=83=BC=E3=83=AB=E3=83=89=E3=81=8C?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/Model/Table/PermissionsTable.php | 5 +++-- .../tests/Scenario/PermissionGroupsScenario.php | 3 +++ .../Controller/Admin/PermissionGroupsControllerTest.php | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/baser-core/src/Model/Table/PermissionsTable.php b/plugins/baser-core/src/Model/Table/PermissionsTable.php index ed50aec353..a0b26be9a1 100644 --- a/plugins/baser-core/src/Model/Table/PermissionsTable.php +++ b/plugins/baser-core/src/Model/Table/PermissionsTable.php @@ -158,8 +158,9 @@ public function validationPlain($validator) public function beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) { $data = $event->getData(); - if (preg_match('/^[^\/]/is', $data["entity"]->get("url"))) { - $data["entity"]->set("url", '/' . $data["entity"]->get("url")); + $url = $data["entity"]->get("url"); + if ($url && preg_match('/^[^\/]/is', $url)) { + $data["entity"]->set("url", '/' . $url); } return true; } diff --git a/plugins/baser-core/tests/Scenario/PermissionGroupsScenario.php b/plugins/baser-core/tests/Scenario/PermissionGroupsScenario.php index e928b72517..450e8b3715 100644 --- a/plugins/baser-core/tests/Scenario/PermissionGroupsScenario.php +++ b/plugins/baser-core/tests/Scenario/PermissionGroupsScenario.php @@ -53,6 +53,7 @@ public function load(...$args) ])->persist(); PermissionFactory::make([ + 'id' => 1, 'no' => 1, 'sort' => 1, 'name' => 'システム管理', @@ -67,6 +68,7 @@ public function load(...$args) ])->persist(); PermissionFactory::make([ + 'id' => 2, 'no' => 1, 'sort' => 1, 'name' => 'よく使う項目', @@ -81,6 +83,7 @@ public function load(...$args) ])->persist(); PermissionFactory::make([ + 'id' => 3, 'no' => 1, 'sort' => 1, 'name' => 'ページ管理', diff --git a/plugins/baser-core/tests/TestCase/Controller/Admin/PermissionGroupsControllerTest.php b/plugins/baser-core/tests/TestCase/Controller/Admin/PermissionGroupsControllerTest.php index 049a124714..77b4437465 100644 --- a/plugins/baser-core/tests/TestCase/Controller/Admin/PermissionGroupsControllerTest.php +++ b/plugins/baser-core/tests/TestCase/Controller/Admin/PermissionGroupsControllerTest.php @@ -107,6 +107,14 @@ public function test_edit() $this->loadFixtureScenario(PermissionGroupsScenario::class); $data = [ 'name' => 'システム基本設定 Update', + 'permissions' => [[ + 'id' => "1", + 'name' => "一覧", + 'user_group_id' => "2", + 'method' => "GET", + 'auth' => "1", + 'status' => "1" + ]] ]; $this->post('/baser/admin/baser-core/permission_groups/edit/1/1', $data); //メッセージを確認 From a8c5f657516d0b161b6ca272a51af77201eef300 Mon Sep 17 00:00:00 2001 From: ryuring Date: Wed, 28 Feb 2024 10:37:45 +0900 Subject: [PATCH 3/4] =?UTF-8?q?sites=20=E3=83=86=E3=83=BC=E3=83=96?= =?UTF-8?q?=E3=83=AB=E3=81=AB=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=8B=E3=82=89=E9=96=A2=E9=80=A3=E4=BB=98=E3=81=91=E3=82=92?= =?UTF-8?q?=E8=A1=8C=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E6=94=B9?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/Middleware/BcAdminMiddleware.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/baser-core/src/Middleware/BcAdminMiddleware.php b/plugins/baser-core/src/Middleware/BcAdminMiddleware.php index efcf89754d..62c455d1c9 100644 --- a/plugins/baser-core/src/Middleware/BcAdminMiddleware.php +++ b/plugins/baser-core/src/Middleware/BcAdminMiddleware.php @@ -65,19 +65,19 @@ public function setCurrentSite($request): ServerRequestInterface $queryCurrentSiteId = $request->getQuery('site_id'); $sitesTable = TableRegistry::getTableLocator()->get('BaserCore.Sites'); if ($queryCurrentSiteId) { - $query = $sitesTable->find()->where(['id' => $queryCurrentSiteId]); + $query = $sitesTable->find()->where(['Sites.id' => $queryCurrentSiteId]); if(!$query->count()) { $request = $request->withQueryParams(array_merge( $request->getQueryParams(), ['site_id' => $defaultSiteId] )); - $query = $sitesTable->find()->where(['id' => $defaultSiteId]); + $query = $sitesTable->find()->where(['Sites.id' => $defaultSiteId]); } $currentSite = $query->first(); } elseif($session->check('BcApp.Admin.currentSite')) { $currentSite = $session->read('BcApp.Admin.currentSite'); } else { - $currentSite = $sitesTable->find()->where(['id' => $defaultSiteId])->first(); + $currentSite = $sitesTable->find()->where(['Sites.id' => $defaultSiteId])->first(); } $session->write('BcApp.Admin.currentSite', $currentSite); From d2e4f099c785372c288ec6607e61c72bcd357316 Mon Sep 17 00:00:00 2001 From: ryuring Date: Wed, 28 Feb 2024 11:44:30 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=83=AB=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=AE=E3=83=97=E3=83=AC=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=A7=E9=80=81=E4=BF=A1=E3=83=9C=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E3=81=8C=E5=B4=A9=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/bc-mail/src/Service/Front/MailFrontService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/bc-mail/src/Service/Front/MailFrontService.php b/plugins/bc-mail/src/Service/Front/MailFrontService.php index 37f4241c1f..8ed02144e0 100644 --- a/plugins/bc-mail/src/Service/Front/MailFrontService.php +++ b/plugins/bc-mail/src/Service/Front/MailFrontService.php @@ -127,6 +127,7 @@ public function setupPreviewForIndex(Controller $controller): void )); $controller->set('title', $mailContent->content->title); $controller->viewBuilder()->setTemplate($this->getIndexTemplate($mailContent)); + $controller->viewBuilder()->setClassName('BcMail.MailFrontApp'); } /**