Commit f17ec0fb65a218b03ee534b93d79517f4877dab1

Authored by Neil Blakey-Milner
1 parent 459bd9fe

Fix sorting in searches and other sorts of partial queries.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4958 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/browse/PartialQuery.inc.php
... ... @@ -269,8 +269,11 @@ class SimpleSearchQuery extends PartialQuery {
269 269 //
270 270 // we also leak like ---- here, since getting the score is ... fiddly. and expensive.
271 271 function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) {
  272 + $this->sDocumentJoinClause = $sJoinClause;
  273 + $this->aDocumentJoinParams = $aJoinParams;
272 274 $aOptions = array(
273 275 'select' => 'DISTINCT D.id AS id',
  276 + 'join' => array($sJoinClause, $aJoinParams),
274 277 );
275 278 $res = $this->getQuery($aOptions);
276 279 if (PEAR::isError($res)) { return array(); }
... ... @@ -374,8 +377,11 @@ class BooleanSearchQuery extends PartialQuery {
374 377 //
375 378 // we also leak like ---- here, since getting the score is ... fiddly. and expensive.
376 379 function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) {
  380 + $this->sDocumentJoinClause = $sJoinClause;
  381 + $this->aDocumentJoinParams = $aJoinParams;
377 382 $aOptions = array(
378 383 'select' => 'DISTINCT D.id AS id',
  384 + 'join' => array($sJoinClause, $aJoinParams),
379 385 );
380 386 $res = $this->getQuery($aOptions);
381 387 if (PEAR::isError($res)) { return array(); }
... ...