Commit e428d976 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make sure HTML export doesn't crash when the user has not folders.

parent e313d2be
...@@ -663,8 +663,10 @@ class HtmlExportOutputFilter { ...@@ -663,8 +663,10 @@ class HtmlExportOutputFilter {
private function get_folder_path_for_file(ArtefactTypeFileBase $file) { private function get_folder_path_for_file(ArtefactTypeFileBase $file) {
if ($this->folderdata === null) { if ($this->folderdata === null) {
$this->folderdata = get_records_select_assoc('artefact', "artefacttype = 'folder' AND owner = ?", array($file->get('owner'))); $this->folderdata = get_records_select_assoc('artefact', "artefacttype = 'folder' AND owner = ?", array($file->get('owner')));
foreach ($this->folderdata as &$folder) { if ($this->folderdata) {
$folder->title = PluginExportHtml::sanitise_path($folder->title); foreach ($this->folderdata as &$folder) {
$folder->title = PluginExportHtml::sanitise_path($folder->title);
}
} }
} }
$folderpath = ArtefactTypeFileBase::get_full_path($file->get('parent'), $this->folderdata); $folderpath = ArtefactTypeFileBase::get_full_path($file->get('parent'), $this->folderdata);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment