check if document exists

This commit is contained in:
Uwe Steinmann 2021-01-14 09:46:34 +01:00
parent feec95eff7
commit 20bc412a17

View File

@ -91,7 +91,7 @@ $(document).ready( function() {
$noaccess = 0; $noaccess = 0;
$docs = []; $docs = [];
foreach ($resArr as $res) { foreach ($resArr as $res) {
$document = $dms->getDocument($res["id"]); if($document = $dms->getDocument($res["id"])) {
$document->verifyLastestContentExpriry(); $document->verifyLastestContentExpriry();
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) { if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
@ -100,6 +100,7 @@ $(document).ready( function() {
$noaccess++; $noaccess++;
} }
} }
}
if($this->hasHook('filterList')) if($this->hasHook('filterList'))
$docs = $this->callHook('filterList', $docs, $action); $docs = $this->callHook('filterList', $docs, $action);
foreach($docs as $document) { foreach($docs as $document) {