From: Marcin Haba Date: Sat, 13 Apr 2019 14:25:45 +0000 (+0200) Subject: baculum: Fix in API part saving job runscript config if RunsWhen=Always X-Git-Tag: Release-9.4.3~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fca88b6200ad8b731be13a538ff8c9739a77cc4f;p=thirdparty%2Fbacula.git baculum: Fix in API part saving job runscript config if RunsWhen=Always --- diff --git a/gui/baculum/protected/API/Class/BaculaSetting.php b/gui/baculum/protected/API/Class/BaculaSetting.php index 4a6d90e1c..8fe5932b4 100644 --- a/gui/baculum/protected/API/Class/BaculaSetting.php +++ b/gui/baculum/protected/API/Class/BaculaSetting.php @@ -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); } }