]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix in API part saving job runscript config if RunsWhen=Always
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 13 Apr 2019 14:25:45 +0000 (16:25 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 15 Apr 2019 19:01:09 +0000 (21:01 +0200)
gui/baculum/protected/API/Class/BaculaSetting.php

index 4a6d90e1ce25b1f624aff4eb659dc896b8b0c261..8fe5932b4ffb151e5b14a68fd68446cb9c8bb48c 100644 (file)
@@ -368,6 +368,14 @@ class BaculaSetting extends APIModule {
                        if ($check_recursive === true) {
                                $resource[$index] = $this->updateSubResource($resource_type, $directive_name, $directive_value);
                        } else {
+                               /**
+                                * Because of bug in bdirjson: http://bugs.bacula.org/view.php?id=2464
+                                * Here is workaround for bdirjson from Bacula versions without fix for it.
+                                * @TODO: Remove it from here ASAP, here shouldn't be this type conditions
+                                */
+                               if ($index === 'RunsWhen' && $directive_value === 'Any') {
+                                       $directive_value = 'Always';
+                               }
                                $resource[$index] = $this->formatDirectiveValue($resource_type, $directive_name, $directive_value);
                        }
                }