Author: jfthomps
Date: Thu Aug 10 20:10:19 2017
New Revision: 1804719

URL: http://svn.apache.org/viewvc?rev=1804719&view=rev
Log:
VCL-1076 - Unsetting Enable Image Library for a management node does not set 
the image library group to NULL

managementnode.php:
-modified AJsaveResource: set imagelibgroupid to NULL if validateResourceData 
returned it as NULL
-modified validateResourceData: if $return['imagelibenable'] is not 1, set 
$return['imagelibgroupid'] to NULL instead of its previous value

Modified:
    vcl/trunk/web/.ht-inc/managementnode.php

Modified: vcl/trunk/web/.ht-inc/managementnode.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/managementnode.php?rev=1804719&r1=1804718&r2=1804719&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/managementnode.php (original)
+++ vcl/trunk/web/.ht-inc/managementnode.php Thu Aug 10 20:10:19 2017
@@ -549,8 +549,12 @@ class ManagementNode extends Resource {
                        if($data['imagelibenable'] != 
$olddata['imagelibenable'])
                                $updates[] = "imagelibenable = 
'{$data['imagelibenable']}'";
                        # imagelibgroupid
-                       if($data['imagelibgroupid'] != 
$olddata['imagelibgroupid'])
-                               $updates[] = "imagelibgroupid = 
'{$data['imagelibgroupid']}'";
+                       if($data['imagelibgroupid'] != 
$olddata['imagelibgroupid']) {
+                               if(is_null($data['imagelibgroupid']))
+                                       $updates[] = "imagelibgroupid = NULL";
+                               else
+                                       $updates[] = "imagelibgroupid = 
'{$data['imagelibgroupid']}'";
+                       }
                        # imagelibuser
                        if($data['imagelibuser'] != $olddata['imagelibuser'])
                                $updates[] = "imagelibuser = 
'{$data['imagelibuser']}'";
@@ -837,7 +841,7 @@ class ManagementNode extends Resource {
                else {
                        $return['imagelibenable'] = 0;
                        if($return['mode'] == 'edit') {
-                               $return['imagelibgroupid'] = 
$olddata['imagelibgroupid'];
+                               $return['imagelibgroupid'] = NULL;
                                $return['imagelibuser'] = 
$olddata['imagelibuser'];
                                $return['imagelibkey'] = 
$olddata['imagelibkey'];
                        }


Reply via email to