From a61d5d5862fd767a7d680d7ef48166378212f9a0 Mon Sep 17 00:00:00 2001 From: ryuring Date: Fri, 23 Feb 2024 11:57:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=AC=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E3=81=AE=E9=9A=9B=E3=80=81?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E4=B8=AD=E6=96=AD=E3=81=9B=E3=81=9A?= =?UTF-8?q?=E3=81=AB=E3=80=81=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E7=AE=87?= =?UTF-8?q?=E6=89=80=E3=81=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/View/Helper/BcBaserHelper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/baser-core/src/View/Helper/BcBaserHelper.php b/plugins/baser-core/src/View/Helper/BcBaserHelper.php index b42de3887a..d80222f0a8 100755 --- a/plugins/baser-core/src/View/Helper/BcBaserHelper.php +++ b/plugins/baser-core/src/View/Helper/BcBaserHelper.php @@ -14,7 +14,6 @@ use BaserCore\Model\Entity\Content; use BaserCore\Model\Entity\Site; use BaserCore\Model\Table\SitesTable; -use BaserCore\Service\PagesService; use BaserCore\Service\PagesServiceInterface; use BaserCore\Utility\BcSiteConfig; use BcBlog\Model\Entity\BlogPost; @@ -34,6 +33,7 @@ use Cake\Routing\Router; use Cake\Utility\Hash; use Cake\Utility\Inflector; +use Cake\View\Exception\MissingElementException; use Cake\View\Helper\BreadcrumbsHelper; use Cake\View\View; use Cake\View\Helper; @@ -323,7 +323,13 @@ public function getElement(string $name, array $data = [], array $options = []) $options = ($event->getResult() === null || $event->getResult() === true)? $event->getData('options') : $event->getResult(); } - $out = $this->_View->element($name, $data, $options); + $out = ''; + try { + $out = $this->_View->element($name, $data, $options); + } catch (MissingElementException $e) { + echo __d('baser_core', 'エレメントテンプレート「{0}」が見つかりませんでした。', $name); + $this->log($e->getMessage()); + } // EVENT afterElement $event = $this->dispatchLayerEvent('afterElement', [