]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix #2667 keep original fileset options order
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 22 May 2022 17:07:57 +0000 (19:07 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 22 May 2022 17:32:55 +0000 (19:32 +0200)
gui/baculum/protected/Web/Portlets/DirectiveFileSet.php

index 6c27c0c48b6bc6b91ace0fb1b6bc59016fa1590f..26c7fa0d24723eac8d1f01b4be5b8fe8f80a84ca 100644 (file)
@@ -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.