]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix renaming resources
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 12 Feb 2019 19:25:26 +0000 (20:25 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Tue, 12 Feb 2019 19:25:53 +0000 (20:25 +0100)
gui/baculum/protected/API/Class/BaculaSetting.php

index 019f730452e9b12afaaeadb396133be2c144b015..4a6d90e1ce25b1f624aff4eb659dc896b8b0c261 100644 (file)
@@ -236,11 +236,13 @@ class BaculaSetting extends APIModule {
                        }
                }
                if ($is_update === false) {
+                       $resource_fname = $this->formatDirectiveValue($resource_type, 'Name', $resource_name);
                        // Existing resource with changed name, or new resource
-                       $resource_index = $this->getConfigResourceIndex($config, $resource_type, $resource_name);
+                       $resource_index = $this->getConfigResourceIndex($config, $resource_type, $resource_fname);
                        if (!is_null($resource_index)) {
                                // Existing resource
                                $resource_orig = $config[$resource_index];
+
                                // Remove existing resource
                                array_splice($config, $resource_index, 1);
                                // Add resource with new name