From 704050afd7f9ad07d620331d6f1b722b43dfda06 Mon Sep 17 00:00:00 2001 From: Robert Lyon Date: Tue, 7 May 2019 14:12:58 +1200 Subject: [PATCH] Bug 1827966: HTML export folder index pages not generated Problem with trying to use expression as variable behatnotneeded Change-Id: I58409ab8373b9db8af9bc1a2b682995e3722f140 Signed-off-by: Robert Lyon (cherry picked from commit 2ab0b2869e18f7b03e7710f5609ddaea5eea63a6) --- htdocs/artefact/file/export/html/lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/artefact/file/export/html/lib.php b/htdocs/artefact/file/export/html/lib.php index ef45da0ecb..52cd701912 100644 --- a/htdocs/artefact/file/export/html/lib.php +++ b/htdocs/artefact/file/export/html/lib.php @@ -201,11 +201,11 @@ class HtmlExportFile extends HtmlExportArtefactPlugin { */ private function prepare_artefacts_for_smarty($parent, $folders) { $data = array(); - $equality = ($folders) ? '==' : '!='; - $parent = (is_null($parent)) ? 'null': intval($parent); + $parent = (is_null($parent)) ? null : intval($parent); $this_owner = $this->owner; - $artefacts = array_filter($this->artefactdata, function($a) use ($parent, $equality, $this_owner) { - if ($a->get("parent") == $parent && $a->get("artefacttype") . $equality . "folder" && $a->get("owner") == $this_owner) { return true; }; + $artefacts = array_filter($this->artefactdata, function($a) use ($parent, $folders, $this_owner) { + if (($folders && $a->get("parent") == $parent && $a->get("artefacttype") == "folder" && $a->get("owner") == $this_owner) || + (!$folders && $a->get("parent") == $parent && $a->get("artefacttype") != "folder" && $a->get("owner") == $this_owner)) { return true; }; }); foreach ($artefacts as $artefact) { -- GitLab