]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix saving job runscript config if RunsWhen=Always
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 13 Apr 2019 13:25:40 +0000 (15:25 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 15 Apr 2019 19:00:55 +0000 (21:00 +0200)
gui/baculum/protected/Web/Portlets/DirectiveRunscript.php

index 91b69fd021c34b3042e8c8d18e50fd007fe02cb9..8558a1a9d906fb3d904a4469f8dd1f5dd025c9b8 100644 (file)
@@ -60,6 +60,14 @@ class DirectiveRunscript extends DirectiveListTemplate {
                                                $directive_value = $config[$i]->{$directive_name};
                                        }
 
+                                       /**
+                                        * 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.
+                                        */
+                                       if ($directive_name === 'RunsWhen' && $directive_value === 'Any') {
+                                               $directive_value = 'Always';
+                                       }
+
                                        $default_value = null;
                                        $data = null;
                                        $field_type = 'TextBox';