Bug 12903 - UseQueryParse, Staff client search incatalog, Duplicated records massage when adding a record.
Summary: UseQueryParse, Staff client search incatalog, Duplicated records massage whe...
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.16
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-10 16:04 UTC by Abdou Yousuf
Modified: 2017-06-14 22:11 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abdou Yousuf 2014-09-10 16:04:39 UTC
Hello,

We have tested search in catalog using (Search the catalog) tab located at the header of staff client
more and more times, but the result always gets
No results found

No results match your search for 'science #'.

Although searching the opac gets results correctly, and advanced search in intranet staff client also

gets results correctly

here: http://library.domain/cgi-bin/koha/opac-search.pl?q=science (opac gets results)

and here: http://library.domain:8080/cgi-bin/koha/catalogue/search.pl?q=science (intranet doesn't get any result)

also we have instances of koha 3.2 and koha 3.14.x and this type of search is working good.


We noticed that activating System preference ( UseQueryParse ) was the reason that has stopped intranet staff client catalog search
when we stopped it the search has been worked correctly.

But stopping this system preference affected on adding new catalog records negatively specially Arabic records, Always the message of (duplicated record) appears.

Here's the reason:
the reason is because (isbn) number in many Arabic records is not necessary in old records, I mean it has the value of (NULL) in koha DB and when checking isbn numbers it considers the NULL values are for the same record, so it always asking if that record is identical to another one in database or not if we entered the record without (isbn) number, so i think the following snippet of code in (search.pm -->koha v3.16.01)

doesn't exclude NULL values when checking record duplication by isbn numbers

# search duplicate on ISBN, easy and fast..
    # ... normalize first
    if ( $result->{isbn} ) {
        $result->{isbn} =~ s/\(.*$//;
        $result->{isbn} =~ s/\s+$//;
        $query = "isbn:$result->{isbn}";
    }

I'm asking if that is a bug???

thanks
Comment 1 Jonathan Druart 2015-07-10 15:42:43 UTC
Hello Abdou,

You should prefer the mailing list for this kind of questions, to get a quickest answer :)

> # search duplicate on ISBN, easy and fast..
>     # ... normalize first
>     if ( $result->{isbn} ) {
>         $result->{isbn} =~ s/\(.*$//;
>         $result->{isbn} =~ s/\s+$//;
>         $query = "isbn:$result->{isbn}";
>     }

This will search for the isbn if an isbn is filled when creating the record.
So if you don't fill it, it shouldn't.

You can try to debug in C4/Search.pm:
 141     warn "SEARCH $query";
 142     my ( $error, $searchresults, undef ) = SimpleSearch($query); # FIXME :: hardcoded !

To know what is the generated query.
Comment 2 Owen Leonard 2016-08-12 14:22:48 UTC
As far as I can tell this bug is not valid in master.