Code

Updated config item mangement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 26 Jul 2011 11:21:57 +0000 (11:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 26 Jul 2011 11:21:57 +0000 (11:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20949 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc

index 43cb84e4fccdf39a1b90ae6d72dc2111618bf3d4..bafb4f53b878945dc2af1afdd79a2c6f78605b36 100644 (file)
@@ -258,6 +258,12 @@ class DeviceConfig extends plugin
      */
     function save()
     {
+        // If no items are assinged we've to remove the extension.
+        if(!count($this->usedElements)) {
+            $this->remove_from_parent();
+            return;
+        }
+
         // Load assignable elements.
         $rpc = $this->config->getRpcHandle();
         $release = $this->parent->by_object['InstallRecipe']->installRelease;