From: Marcin Haba Date: Sun, 22 May 2022 17:07:57 +0000 (+0200) Subject: baculum: Fix #2667 keep original fileset options order X-Git-Tag: Release-13.0.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dedabb42f170244e49e7d5254f62a32fa8f37ad;p=thirdparty%2Fbacula.git baculum: Fix #2667 keep original fileset options order --- diff --git a/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php b/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php index 6c27c0c48..26c7fa0d2 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveFileSet.php @@ -395,6 +395,10 @@ class DirectiveFileSet extends DirectiveListTemplate { if (!is_array($directive_values['Include'][$i]) || !key_exists('Options', $directive_values['Include'][$i])) { continue; } + + // First sort options by key to keep original order + ksort($directive_values['Include'][$i]['Options']); + /** * Options $index can start from value greater than 0, so here reset indexes * to avoid undefined offset error.