Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003
Summary: Authorities searches with double quotes gives ZOOM error 20003
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-26 09:04 UTC by Miguel Tuimil
Modified: 2017-06-26 15:18 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 16976: Authorities searches with double quotes gives ZOOM error 20003 (2.19 KB, patch)
2017-06-05 07:15 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16976: Authorities searches with double quotes gives ZOOM error 20003 (2.24 KB, patch)
2017-06-05 14:54 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate] (1.20 KB, patch)
2017-06-16 10:54 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate] (1.25 KB, patch)
2017-06-16 13:36 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate] (1.30 KB, patch)
2017-06-26 15:18 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Tuimil 2016-07-26 09:04:07 UTC
Any search on authorities(authorities/authorities-home.pl) that includes double quotes, for example "Enrico Fermi" gives:

Software error:

ZOOM error 20003 "can't set prefix query" (addinfo: "@or @attr 7=1 @attr 1=Heading 0  @attr 1=Heading-Main  @attr 5=1 @attr 4=6 "\\"Enrico Fermi\\""") from diag-set 'ZOOM'
Comment 1 Marc Véron 2017-05-29 05:30:30 UTC
Confirmed on current master.
Steps to reproduce:

Go to Home > Authorities
Search "test" (including double quotes

Result: Internal server error, plack error log says:
ZOOM error 20003 "can't set prefix query" (addinfo: "@or @attr 7=1 @attr 1=Heading 0  @attr 1=Heading-Main  @attr 5=1 @attr 4=6 "\\"test\\""") from diag-set 'ZOOM'

Same with search after "test (one qoute only
Comment 2 Marc Véron 2017-06-05 07:15:48 UTC
Created attachment 63957 [details] [review]
Bug 16976: Authorities searches with double quotes gives ZOOM error 20003

To recreate:
Go to Home > Authorities
Search "test" (including double quotes

Result: Internal server error, plack error log says:
ZOOM error 20003 "can't set prefix query" (addinfo: "@or @attr 7=1 @attr 1=Heading 0  @attr 1=Heading-Main  @attr 5=1 @attr 4=6 "\\"test\\""") from diag-set 'ZOOM'

To test:
- Appply patch, restart memchached an dplack
- Repeat search "test"
- Verify that there is no internal server error
- Add an authority containing quotes, e.g. Johann "Wolfie" Goethe
- Search after Wolfie (without quotes)
- Verify that authority ist found
- Search after "Wolfie"
- Verify that authority is found
- Verify that other searches for authorities behave as before

Technical note: Escaping did not work. The patch simply removes double
quotes from search values. Not sure if that is the ultimate solution, but
it works.
Comment 3 Lee Jamison 2017-06-05 14:54:18 UTC
Created attachment 63963 [details] [review]
Bug 16976: Authorities searches with double quotes gives ZOOM error 20003

To recreate:
Go to Home > Authorities
Search "test" (including double quotes

Result: Internal server error, plack error log says:
ZOOM error 20003 "can't set prefix query" (addinfo: "@or @attr 7=1 @attr 1=Heading 0  @attr 1=Heading-Main  @attr 5=1 @attr 4=6 "\\"test\\""") from diag-set 'ZOOM'

To test:
- Appply patch, restart memchached an dplack
- Repeat search "test"
- Verify that there is no internal server error
- Add an authority containing quotes, e.g. Johann "Wolfie" Goethe
- Search after Wolfie (without quotes)
- Verify that authority ist found
- Search after "Wolfie"
- Verify that authority is found
- Verify that other searches for authorities behave as before

Technical note: Escaping did not work. The patch simply removes double
quotes from search values. Not sure if that is the ultimate solution, but
it works.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 4 Nick Clemens 2017-06-16 10:54:06 UTC
Created attachment 64382 [details] [review]
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate]

I dug into this a little bit, it seems the issue is that we were double
processing the query because of an extra call to
C4::AuthoritiesMarc::SearchAuthorities

I think we can simply remove this call

To test:
1 - Perform an authority search for a value that returns results
2 - Wrap it in quotes and search
3 - 'Internal server error'
4 - Apply patch
5 - Search with quotes succeeds

https://bugs.koha-community.org/show_bug.cgi?id=16796
Comment 5 Lee Jamison 2017-06-16 13:36:40 UTC
Created attachment 64384 [details] [review]
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate]

I dug into this a little bit, it seems the issue is that we were double
processing the query because of an extra call to
C4::AuthoritiesMarc::SearchAuthorities

I think we can simply remove this call

To test:
1 - Perform an authority search for a value that returns results
2 - Wrap it in quotes and search
3 - 'Internal server error'
4 - Apply patch
5 - Search with quotes succeeds

https://bugs.koha-community.org/show_bug.cgi?id=16796

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
When testing in kohadevbox a restart_all is required
Comment 6 Tomás Cohen Arazi 2017-06-26 15:18:46 UTC
Created attachment 64655 [details] [review]
Bug 16976 - Authorities searches with double quotes gives ZOOM error 20003 [Alternate]

I dug into this a little bit, it seems the issue is that we were double
processing the query because of an extra call to
C4::AuthoritiesMarc::SearchAuthorities

I think we can simply remove this call

To test:
1 - Perform an authority search for a value that returns results
2 - Wrap it in quotes and search
3 - 'Internal server error'
4 - Apply patch
5 - Search with quotes succeeds

https://bugs.koha-community.org/show_bug.cgi?id=16796

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>