mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
Fix #2217 call getDocumentList (after) trigger even if there are no results
This commit is contained in:
parent
4a2ea92f07
commit
c2311f88be
1 changed files with 15 additions and 12 deletions
|
|
@ -265,26 +265,29 @@ class DocumentModel extends Document
|
||||||
$output = executeQueryArray($query_id, $args, $args->columnList);
|
$output = executeQueryArray($query_id, $args, $args->columnList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return if no result or an error occurs
|
// Return if there was an error.
|
||||||
if(!$output->toBool() || !$result = $output->data)
|
if (!$output->toBool())
|
||||||
{
|
{
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output->data = array();
|
// Create document objects and load extra vars.
|
||||||
foreach($result as $key => $attribute)
|
if ($output->data)
|
||||||
{
|
{
|
||||||
if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl]))
|
foreach ($output->data as $key => $attribute)
|
||||||
{
|
{
|
||||||
$oDocument = new documentItem();
|
if (!isset($GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl]))
|
||||||
$oDocument->setAttribute($attribute, false);
|
{
|
||||||
|
$oDocument = new DocumentItem();
|
||||||
|
$oDocument->setAttribute($attribute, false);
|
||||||
|
}
|
||||||
|
$output->data[$key] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||||
}
|
}
|
||||||
$output->data[$key] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($load_extra_vars)
|
if ($load_extra_vars)
|
||||||
{
|
{
|
||||||
self::setToAllDocumentExtraVars();
|
self::setToAllDocumentExtraVars();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call trigger (after)
|
// Call trigger (after)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue