mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix missing extra vars when document cache is cleared in the middle of a script #2553
This commit is contained in:
parent
1d558204d1
commit
a1f452fa83
2 changed files with 9 additions and 9 deletions
|
|
@ -1775,6 +1775,7 @@ class DocumentController extends Document
|
|||
$output = executeQuery('document.updateDocumentExtraVar', $obj);
|
||||
}
|
||||
|
||||
unset($GLOBALS['XE_EXTRA_KEYS'][$module_srl]);
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_document_extra_keys:$module_srl");
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1831,6 +1832,7 @@ class DocumentController extends Document
|
|||
|
||||
$oDB->commit();
|
||||
|
||||
unset($GLOBALS['XE_EXTRA_KEYS'][$module_srl]);
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_document_extra_keys:$module_srl");
|
||||
return new BaseObject();
|
||||
}
|
||||
|
|
@ -3708,6 +3710,7 @@ Content;
|
|||
if ($type === 'all' || $type === 'extra_vars')
|
||||
{
|
||||
unset($GLOBALS['XE_EXTRA_VARS'][$document_srl]);
|
||||
unset($GLOBALS['XE_EXTRA_CHK'][$document_srl]);
|
||||
unset($GLOBALS['RX_DOCUMENT_LANG'][$document_srl]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,19 +55,16 @@ class DocumentModel extends Document
|
|||
return;
|
||||
}
|
||||
|
||||
static $checked = array();
|
||||
static $module_extra_keys = array();
|
||||
|
||||
// check documents
|
||||
$document_srls = array();
|
||||
foreach($_document_list as $document_srl => $oDocument)
|
||||
{
|
||||
if(isset($checked[$document_srl]) || !($oDocument instanceof documentItem) || !$oDocument->isExists())
|
||||
if(isset($GLOBALS['XE_EXTRA_CHK'][$document_srl]) || !($oDocument instanceof documentItem) || !$oDocument->isExists())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$checked[$document_srl] = true;
|
||||
$GLOBALS['XE_EXTRA_CHK'][$document_srl] = true;
|
||||
$document_srls[] = $document_srl;
|
||||
}
|
||||
|
||||
|
|
@ -102,16 +99,16 @@ class DocumentModel extends Document
|
|||
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl]))
|
||||
{
|
||||
// get extra keys of the module
|
||||
if(!isset($module_extra_keys[$module_srl]))
|
||||
if(!isset($GLOBALS['XE_EXTRA_KEYS'][$module_srl]))
|
||||
{
|
||||
$module_extra_keys[$module_srl] = self::getExtraKeys($module_srl);
|
||||
$GLOBALS['XE_EXTRA_KEYS'][$module_srl] = self::getExtraKeys($module_srl);
|
||||
}
|
||||
|
||||
// set extra variables of the document
|
||||
if($module_extra_keys[$module_srl])
|
||||
if(!empty($GLOBALS['XE_EXTRA_KEYS'][$module_srl]))
|
||||
{
|
||||
$document_extra_vars = array();
|
||||
foreach($module_extra_keys[$module_srl] as $idx => $key)
|
||||
foreach($GLOBALS['XE_EXTRA_KEYS'][$module_srl] as $idx => $key)
|
||||
{
|
||||
$document_extra_vars[$idx] = clone($key);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue