Bug ID: 17710
           Summary: C4::Matcher::get_matches and
                    C4::ImportBatch::GetBestRecordMatch should use same
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: MARC Bibliographic record staging/import
        QA Contact:

C4::Matcher::get_matches sorts its rows in descending order using score, while
C4::ImportBatch::GetBestRecordMatch sorts its rows in descending order using
score and record id. 

To get the best record match, C4::ImportBatch::GetBestRecordMatch takes the top

By contrast, C4::Matcher::get_matches could easily return different rows in the
top position if there are multiple rows with the same score, since its array is
populated using a hash where order doesn't matter. 

It's an easy enough fix,  although I will admit to finding the solution on

"Since <=> and cmp return 0 to indicate equality, and that's false, and because
Perl's logical Boolean operators return the deciding value instead of just 0 or
1, sorting by multiple keys is as easy as stringing multiple comparisons
together with or or ||"

You are receiving this mail because:
You are watching all bug changes.
Koha-bugs mailing list
website :
git :
bugs :

Reply via email to