Fix layout cache not being refreshed when info.xml is edited

This commit is contained in:
Kijin Sung 2021-01-12 10:44:19 +09:00
parent 7e0e6bc25f
commit b837e3e69e
3 changed files with 5 additions and 4 deletions

View file

@ -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)

View file

@ -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();

View file

@ -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;
}