If you create a basket and add an orderline from a suggestion, you get a suggestions search bar at the top which allows you to search by title, author and publisher. Author and publisher search fine but title returns a 500 error. The logs suggest the title in the SQL query is not unique DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'title' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 401 title is, of course, in both the suggestions table and the borrowers table, the query doesn't seem to make this distinction.
Created attachment 175091 [details] [review] Bug 38606: Fix suggestion title search Test plan: 1) From a basket, click Add to basket and then From a suggestion 2) In the search bar at the top, type something into the Title field and hit enter 3) There will be 500 error 4) Apply patch and restart_all 5) Repeat steps 1-2, no error
I had a go at testing, but I think something else is also going on. After the patch, if I use the search, I no longer get an error message - as expected. If I don't do a search, and click +Order, everything works as expected - you can carry on adding the suggestion to the order. However, if I do a search and then click the +Order, it results in a "Basket not found" message: - The URL doesn't have the basketno: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=&suggestionid=1 - The breadcrumb is: Acquisitions > > Basket > New order In addition, if I search for "Something" (the other suggestion created in the steps to replicate), I get: - "There are no outstanding (accepted) suggestions." (even though it was in the table with all the suggestions listed) - The URL is: /cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=1&title=something&author=&publishercode= - The breadcrumb is: Acquisitions > My Vendor > Basket > Add order from a suggestion Steps to replicate (using KTD): 1. Add two suggestions, and change their status to accepted - one with the title "Test" and another with the title "Something else". 2. Go to a basket and then select add to basket 3. Select "From a suggestion" from the dialog box 4. Accepted suggestions are listed, and the header search is now "Search suggestions" with fields for Title, Author, Publisher. 5. Entering "test" should adjust the table so that one suggestion is listed 6. Click +Order 7. Get "Basket not found" 8. If I don't use search,