소스 검색

Fixed a regression introduced by #930: a field can depend on a hidden fields, but this has no visible effect.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3210 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 년 전
부모
커밋
7dfcec6ec6
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      application/cmdbabstract.class.inc.php

+ 7 - 1
application/cmdbabstract.class.inc.php

@@ -2494,6 +2494,12 @@ EOF
 						// Dependency is resolved, remove it
 						unset($aFields[$sFieldCode][$key]);
 					}
+					else if (!array_key_exists($sDependency, $aFields))
+					{
+						// The current fields depends on a field not present in the form
+						// let's ignore it (since it cannot change)
+						unset($aFields[$sFieldCode][$key]);						
+					}
 				}
 				if (count($aFields[$sFieldCode]) == 0)
 				{
@@ -2508,7 +2514,7 @@ EOF
 		
 		if (count($aFields) > 0)
 		{
-			$sMessage =  "Error: Circular dependencies between the fields (or field missing in ZList) ! <pre>".print_r($aFields, true)."</pre>";
+			$sMessage =  "Error: Circular dependencies between the fields! <pre>".print_r($aFields, true)."</pre>";
 			throw(new Exception($sMessage));
 		}
 		return $aResult;