[Koha-bugs] [Bug 5864] Is C4::Serials::GetSubscriptions searching too generally?

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 31 17:45:30 CEST 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5864

--- Comment #9 from Frédérick Capovilla <fcapovilla at live.ca> 2011-05-31 15:45:30 UTC ---
Here is the comment of this subroutine :
this function gets all subscriptions which have title like $title,ISSN like
$ISSN and biblionumber like $biblionumber.

With this description, I thought that the subroutines would return all
subscriptions with the specified title AND ISSN AND biblionumber.
Right now, it doesn't exactly returns that because the ANDs and ORs of the
query are all mixed together without useful parentheses.

If I'm not wrong, with MySQL's operator precedences, the current query looks
like this :
(biblio.biblionumber=? AND biblio.title LIKE ? ) OR
subscription.callnumber LIKE ? OR
subscription.location LIKE ? OR
subscription.notes LIKE ? OR 
(subscription.internalnotes LIKE ? AND biblioitems.issn LIKE ? ) OR
subscription.callnumber LIKE ?

I think it was meant to be like this :
(biblio.biblionumber=?) AND 
(biblio.title LIKE ? OR subscription.callnumber LIKE ? OR subscription.location
LIKE ? OR subscription.notes LIKE ? OR subscription.internalnotes LIKE ?) AND
(biblioitems.issn LIKE ? OR subscription.callnumber LIKE ?)


I understand that the current fix does solve the problem, but I just want to
bring to someone's attention that the GetSubscriptions subroutine might not
work as intended.

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list