From b837e3e69e479f239a6fe64b43880d74dfb5a1c5 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 12 Jan 2021 10:44:19 +0900 Subject: [PATCH] Fix layout cache not being refreshed when info.xml is edited --- modules/layout/layout.admin.model.php | 2 +- modules/layout/layout.admin.view.php | 2 +- modules/layout/layout.model.php | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/layout/layout.admin.model.php b/modules/layout/layout.admin.model.php index 506b81c6c..b85ff6636 100644 --- a/modules/layout/layout.admin.model.php +++ b/modules/layout/layout.admin.model.php @@ -62,7 +62,7 @@ class layoutAdminModel extends layout // Get layout information $oLayoutModel = getModel('layout'); - $layout_info = $oLayoutModel->getLayout($layout_srl); + $layout_info = $oLayoutModel->getLayout($layout_srl, false); // Error appears if there is no layout information is registered if(!$layout_info) diff --git a/modules/layout/layout.admin.view.php b/modules/layout/layout.admin.view.php index 9dc793a9b..6cbc12cc3 100644 --- a/modules/layout/layout.admin.view.php +++ b/modules/layout/layout.admin.view.php @@ -232,7 +232,7 @@ class layoutAdminView extends layout $layout_srl = Context::get('layout_srl'); // Get layout information $oLayoutModel = getModel('layout'); - $layout_info = $oLayoutModel->getLayout($layout_srl); + $layout_info = $oLayoutModel->getLayout($layout_srl, false); // Error appears if there is no layout information is registered if(!$layout_info) return $this->dispLayoutAdminInstalledList(); diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php index 8a157509a..d541caf7e 100644 --- a/modules/layout/layout.model.php +++ b/modules/layout/layout.model.php @@ -265,13 +265,14 @@ class layoutModel extends layout * Get one of layout information created in the DB * Return DB info + XML info of the generated layout * @param int $layout_srl + * @param bool $use_cache * @return object info of layout */ - function getLayout($layout_srl) + function getLayout($layout_srl, $use_cache = true) { // Get information from cache $layout_info = Rhymix\Framework\Cache::get("layout:$layout_srl"); - if ($layout_info !== null) + if ($use_cache && $layout_info !== null) { return $layout_info; }