浏览代码

#403 Partial installation not working (error on ticket form)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1268 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父节点
当前提交
d3067f3045
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      core/metamodel.class.php

+ 7 - 1
core/metamodel.class.php

@@ -1535,7 +1535,13 @@ abstract class MetaModel
 		{
 			if (is_array($attCode))
 			{
-				self::Init_CheckZListItems($attCode, $sTargetClass);
+				// Note: to make sure that the values will be updated recursively,
+				//  do not pass $attCode, but $aItems[$iFoo] instead
+				self::Init_CheckZListItems($aItems[$iFoo], $sTargetClass);
+				if (count($aItems[$iFoo]) == 0)
+				{
+					unset($aItems[$iFoo]);
+				}
 			}
 			else if (isset(self::$m_aIgnoredAttributes[$sTargetClass][$attCode]))
 			{