patron name keyword search can crash

Bug #1790689 reported by Galen Charlton
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

The patron name keyword search, introduced in bug 1776020, can crash when supplied with a single quotation mark as the search string. The associated error message is:

net.js:119 error calling method open-ils.actor.patron.search.advanced.fleshed : 500 : *** Call to [open-ils.actor.patron.search.advanced.fleshed] failed for session [0.98703998489481461536081818521], thread trace [0]:
Exception: OpenSRF::EX::ERROR 2018-09-04T13:41:40 OpenSRF::Application /usr/local/share/perl/5.24.1/OpenSRF/Application.pm:243 System ERROR: Call to open-ils.storage for method open-ils.storage.actor.user.crazy_search
 failed with exception: Exception: OpenSRF::EX::ERROR 2018-09-04T13:41:40 OpenILS::Application::AppUtils /usr/local/share/perl/5.24.1/OpenILS/Application/AppUtils.pm:201 System ERROR: Exception: OpenSRF::DomainObject::oilsMethodException 2018-09-04T13:41:40 OpenSRF::AppRequest /usr/local/share/perl/5.24.1/OpenSRF/AppSession.pm:1149 <500> *** Call to [open-ils.storage.actor.user.crazy_search] failed for session [1536082899.863611540.94075152383], thread trace [1]:
DBD::Pg::db selectcol_arrayref failed: ERROR: syntax error in tsquery: "':*" [for Statement " SELECT evergreen.lowercase(CAST(users.family_name AS text)), evergreen.lowercase(CAST(users.first_given_name AS text)), evergreen.lowercase(CAST(users.second_given_name AS text)), evergreen.lowercase(CAST(users.dob AS text)), evergreen.lowercase(CAST(users.id AS text))
          FROM actor.usr AS users
            JOIN actor.org_unit_descendants(1) d ON (d.id = users.home_ou)
            JOIN (SELECT id as id FROM actor.usr u WHERE name_kw_tsvector @@ to_tsquery(?)) AS search ON (search.id = users.id)

          WHERE users.deleted = FALSE
            AND users.active = TRUE

          GROUP BY evergreen.lowercase(CAST(users.family_name AS text)), evergreen.lowercase(CAST(users.first_given_name AS text)), evergreen.lowercase(CAST(users.second_given_name AS text)), evergreen.lowercase(CAST(users.dob AS text)), evergreen.lowercase(CAST(users.id AS text))
          ORDER BY evergreen.lowercase(CAST(users.family_name AS text)) ASC, evergreen.lowercase(CAST(users.first_given_name AS text)) ASC, evergreen.lowercase(CAST(users.second_given_name AS text)) ASC, evergreen.lowercase(CAST(users.dob AS text)) DESC, evergreen.lowercase(CAST(users.id AS text))
          LIMIT 25
          OFFSET 0
"] at /usr/local/share/perl/5.24.1/OpenILS/Application/Storage/Publisher/actor.pm line 903.

 :

Evergreen master

Tags: patron
Galen Charlton (gmc)
description: updated
Revision history for this message
Michele Morgan (mmorgan) wrote :

Confirmed in Master circa 3.7.1, though I did not get the error when first bringing op the search form and executing a name keyword search with a single quote. In this case the page hangs with the progress bar displaying, but no error appears in the console.

Upon refreshing the page and performing the name keyword search with the single quote, I do see the error.

Changed in evergreen:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.