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

#200 ToOQL() was not working anytime an argument was set onto the Filter object

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@701 a333f486-631f-4898-b8df-5754b55c2be0
romainq 15 роки тому
батько
коміт
762699b3fe
2 змінених файлів з 9 додано та 9 видалено
  1. 4 7
      core/dbobjectsearch.class.php
  2. 5 2
      core/metamodel.class.php

+ 4 - 7
core/dbobjectsearch.class.php

@@ -560,14 +560,12 @@ class DBObjectSearch
 
 	public function ToOQL(&$aParams = null)
 	{
-		$bRetrofitParams = (!is_null($aParams));
+		// Currently unused, but could be useful later
+		$bRetrofitParams = false;
+
 		if (is_null($aParams))
 		{
-			if (count($this->m_aParams) > 0)
-			{
-				$aParams = $this->m_aParams;
-			}
-			$bRetrofitParams = false;
+			// Leave it as is, the rendering will be made with parameters in clear
 		}
 		else
 		{
@@ -575,7 +573,6 @@ class DBObjectSearch
 			{
 				$aParams = array_merge($aParams, $this->m_aParams);
 			}
-			$bRetrofitParams = true;
 		}
 
 		$sSelectedClasses = implode(', ', array_keys($this->m_aSelectedClasses));

+ 5 - 2
core/metamodel.class.php

@@ -1533,8 +1533,7 @@ abstract class MetaModel
 		// Query caching
 		//
 		$bQueryCacheEnabled = true;
-		$aParams = array();
-		$sOqlQuery = $oFilter->ToOql($aParams); // Render with arguments in clear
+		$sOqlQuery = $oFilter->ToOql();
 		if ($bQueryCacheEnabled)
 		{
 			// Warning: using directly the query string as the key to the hash array can FAIL if the string
@@ -1553,6 +1552,10 @@ abstract class MetaModel
 				$oSelect = clone self::$m_aQueryStructCache[$sOqlQuery];
 			}
 		}
+		else
+		{
+			$sOqlQuery = "dummy";
+		}
 
 		if (!isset($oSelect))
 		{