check if parent folder exists in getListRowPath()

This commit is contained in:
Uwe Steinmann 2021-04-22 10:22:03 +02:00
parent b291149644
commit 7f4c9a036d

View File

@ -2753,13 +2753,16 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* @return string * @return string
*/ */
function getListRowPath($object) { /* {{{ */ function getListRowPath($object) { /* {{{ */
$belowtitle = "<br /><span style=\"font-size: 85%;\">".getMLText('in_folder').": /"; $belowtitle = '';
$folder = $object->getParent(); $folder = $object->getParent();
$path = $folder->getPath(); if($folder) {
for ($i = 1; $i < count($path); $i++) { $belowtitle .= "<br /><span style=\"font-size: 85%;\">".getMLText('in_folder').": /";
$belowtitle .= htmlspecialchars($path[$i]->getName())."/"; $path = $folder->getPath();
for ($i = 1; $i < count($path); $i++) {
$belowtitle .= htmlspecialchars($path[$i]->getName())."/";
}
$belowtitle .= "</span>";
} }
$belowtitle .= "</span>";
return $belowtitle; return $belowtitle;
} /* }}} */ } /* }}} */