From d0dba2d01646c5db3e0d392d41fc03bb5444b6f5 Mon Sep 17 00:00:00 2001 From: ryuring Date: Sat, 14 Dec 2024 10:02:40 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AE=E6=96=B0=E8=A6=8F=E4=BD=9C=E6=88=90=E6=99=82=E3=80=81?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E8=80=85=E3=81=AE=E5=88=9D=E6=9C=9F=E5=80=A4?= =?UTF-8?q?=E3=82=92=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/Service/PagesService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/baser-core/src/Service/PagesService.php b/plugins/baser-core/src/Service/PagesService.php index c211fff261..559b281336 100644 --- a/plugins/baser-core/src/Service/PagesService.php +++ b/plugins/baser-core/src/Service/PagesService.php @@ -98,6 +98,10 @@ public function getNew(int $parentId = null, string $name = ''): EntityInterface $name = BcUtil::urlencode(mb_substr($name, 0, 230, 'UTF-8')); } else { $title = ''; + } + $authorId = null; + if(BcUtil::isAdminUser()) { + $authorId = BcUtil::loginUser()->id; } return $this->Pages->newEntity([ 'content' => [ @@ -110,7 +114,8 @@ public function getNew(int $parentId = null, string $name = ''): EntityInterface 'site_root' => false, 'site_id' => $parent->site_id, 'parent_id' => $parent->id, - 'self_status' => false + 'self_status' => false, + 'author_id' => $authorId ] ], ['associated' => ['Contents' => ['validate' => false]]]); }