Commit 85ffd4cf6ab54c441329fda0c8ae25e840e8b83d

Authored by nbm
1 parent 5b22aa04

KTS220 - fix metadata search to use metadata version ID instead of

document ID.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4686 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 3 additions and 3 deletions
lib/browse/Criteria.inc
... ... @@ -396,9 +396,9 @@ class GenericMetadataCriterion extends BrowseCriterion {
396 396 global $default;
397 397 $sQuery = "SELECT DFL.value as value " .
398 398 "FROM $default->document_fields_link_table AS DFL " .
399   - "WHERE DFL.document_id = ? " .
  399 + "WHERE DFL.metadata_version_id = ? " .
400 400 "AND DFL.document_field_id = ?";
401   - $aParams = array($oDocument->getID(), $this->getID());
  401 + $aParams = array($oDocument->getMetadataVersionId(), $this->getID());
402 402  
403 403 $res = DBUtil::getOneResultKey(array($sQuery, $aParams), 'value');
404 404 if (PEAR::isError($res)) {
... ... @@ -453,7 +453,7 @@ class GenericMetadataCriterion extends BrowseCriterion {
453 453  
454 454 function searchJoinSQL () {
455 455 global $default;
456   - return "LEFT JOIN $default->document_fields_link_table AS $this->sSearchTable ON $this->sSearchTable.document_id = D.id";
  456 + return "LEFT JOIN $default->document_fields_link_table AS $this->sSearchTable ON $this->sSearchTable.metadata_version_id = D.metadata_version_id";
457 457 }
458 458 }
459 459  
... ...