diff --git a/core/dbunionsearch.class.php b/core/dbunionsearch.class.php index 597e2f746..32721c45e 100644 --- a/core/dbunionsearch.class.php +++ b/core/dbunionsearch.class.php @@ -604,7 +604,9 @@ class DBUnionSearch extends DBSearch */ public function GetCriteria() { - return new TrueExpression(); + // We're at the limit here + $oSearch = reset($this->aSearches); + return $oSearch->GetCriteria(); } protected function IsDataFiltered() diff --git a/pages/ajax.searchform.php b/pages/ajax.searchform.php index a4989751b..68d6fdaf2 100644 --- a/pages/ajax.searchform.php +++ b/pages/ajax.searchform.php @@ -91,11 +91,11 @@ try $oObj = $oWizardHelper->GetTargetObject(); if (array_key_exists('query_params', $aExtraParams)) { - $aExtraParams['query_params']['this'] = $oObj; + $aExtraParams['query_params']['this->object()'] = $oObj; } else { - $aExtraParams['query_params'] = array('this' => $oObj); + $aExtraParams['query_params'] = array('this->object()' => $oObj); } // // Current extkey value, so we can display event if it is not available anymore (eg. archived). diff --git a/sources/application/search/searchform.class.inc.php b/sources/application/search/searchform.class.inc.php index bf8efd21b..5705ca6d5 100644 --- a/sources/application/search/searchform.class.inc.php +++ b/sources/application/search/searchform.class.inc.php @@ -203,7 +203,7 @@ class SearchForm } $oBaseSearch = $oSearch->DeepClone(); - if (method_exists($oSearch, 'GetCriteria')) + if ($oSearch instanceof DBObjectSearch) { $oBaseSearch->ResetCondition(); } @@ -495,7 +495,7 @@ class SearchForm $bIsEmptyExpression = true; $aArgs = MetaModel::PrepareQueryArguments($aArgs, $oSearch->GetInternalParams()); - if (method_exists($oSearch, 'GetCriteria')) + if ($oSearch instanceof DBObjectSearch) { $oExpression = $oSearch->GetCriteria();