Forráskód Böngészése

Portal : Fixed a bug in linkedset when removing last object

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4004 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 9 éve
szülő
commit
e8bf965bbc

+ 7 - 1
sources/renderer/bootstrap/fieldrenderer/bslinkedsetfieldrenderer.class.inc.php

@@ -168,7 +168,13 @@ EOF
 					'get_current_value_callback': function(me, oEvent, oData){
 						var value = null;
 
-						value = JSON.parse(me.element.find('#{$this->oField->GetGlobalId()}').val());
+						// Retrieving JSON value as a string and not an object
+						//
+						// Note : The value is passed as a string instead of an array because the attribute would not be included in the posted data when empty.
+						// Which was an issue when deleting all objects from linkedset
+						//
+						// Old code : value = JSON.parse(me.element.find('#{$this->oField->GetGlobalId()}').val());
+						value = me.element.find('#{$this->oField->GetGlobalId()}').val();
 
 						return value;
 					},