Переглянути джерело

Impact analysis: better error report if the data model defines redundancy on a unidirectional relation (make it easier to troubleshoot for consultants)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4840 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 роки тому
батько
коміт
e292cc1f0d
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      core/relationgraph.class.inc.php

+ 4 - 0
core/relationgraph.class.inc.php

@@ -457,6 +457,10 @@ class RelationGraph extends SimpleGraph
 			{
 				// Get the upper neighbours
 				$sQuery = $aQueryInfo['sQueryUp'];
+				if (!$sQuery)
+				{
+					throw new Exception("Redundancy cannot be enabled on the relation $sRelCode/{$aQueryInfo['sDefinedInClass']}/{$aQueryInfo['sNeighbour']}: its direction is \"{$aQueryInfo['sDirection']}\"");
+				}
 				try
 				{
 					$oFlt = static::MakeSearch($sQuery);