From: Marcin Haba Date: Wed, 7 Aug 2019 05:06:11 +0000 (+0200) Subject: baculum: Fix removing fileset options subresources X-Git-Tag: Release-9.6.0~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d829279b890391f52ee8ec7fc83bd5a27df48bad;p=thirdparty%2Fbacula.git baculum: Fix removing fileset options subresources --- diff --git a/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php b/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php index 89fdb4b4b..357d35eac 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php @@ -101,6 +101,7 @@ class DirectiveFileSet extends DirectiveListTemplate { $this->setFile($exclude, 'File', $subres['File']); } } + $this->RepeaterFileSetIncludes->DataSource = $includes; $this->RepeaterFileSetIncludes->dataBind(); $this->RepeaterFileSetExclude->DataSource = $exclude; @@ -379,6 +380,17 @@ class DirectiveFileSet extends DirectiveListTemplate { array_push($directive_values['Exclude']['File'], $directive_value); } } + for ($i = 0; $i < count($directive_values['Include']); $i++) { + if (!is_array($directive_values['Include'][$i]) || !key_exists('Options', $directive_values['Include'][$i])) { + continue; + } + /** + * Options $index can start from value greater than 0, so here reset indexes + * to avoid undefined offset error. + */ + $directive_values['Include'][$i]['Options'] = array_values($directive_values['Include'][$i]['Options']); + } + return $directive_values; }