[Bug 7620] New: OPACNoResult, add search string to available parameters
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Bug #: 7620 Summary: OPACNoResult, add search string to available parameters Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: OPAC AssignedTo: paul.poulain@biblibre.com ReportedBy: paul.poulain@biblibre.com QAContact: koha.sekjal@gmail.com When OPACNoResult contain something, it would be usefull to be able to have the search string entered by the patron -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #1 from Koha Team Lyon 3 <koha@univ-lyon3.fr> 2012-02-29 13:54:07 UTC --- Created attachment 7941 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7941 Bug 7620 OPACNoResult, add search string to available parameters This patch add the string entered by the user to OPACNoResultFound Test plan: * activate OPACNoResultFound and use "query_kw" somewhere. For example : <a href="www.google.com?q=query_kw">Search on Google</a> * try a search that return no result * you should see the link to search the query on google -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|paul.poulain@biblibre.com |koha@univ-lyon3.fr -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #2 from Nicole C. Engard <nengard@gmail.com> 2012-03-01 13:59:19 UTC --- I have not tested this yet, but we should probably follow the style set forth in other preferences so instead of "query_kw" it should be "{query_kw}" maybe even in all caps. That's how it's done on the other preferences where we enter placeholders. Nicole -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |jcamins@cpbibliography.com --- Comment #3 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- I agree with Nicole. Using a literal string is inconsistent and just asking for trouble. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7941|0 |1 is obsolete| | --- Comment #4 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Created attachment 8713 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8713&action=edit OPACNoResults, add keyword to search string The same patch redone with place holder -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |chris@bigballofwax.co.nz --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- I like the idea of this patch, but unfortunately it adds an xss vulnerability. For example, if I searched on
<script type="text/javascript" src="http://link/to/evil.js"></script> that would be substituted and output (and run).
OPACNoResult is not piped through the html filter, because then it couldn't have links in it, so it's not a simple fix to just change that. Probably the easiest fix is to run the $query_kw through HTML::Scrubber before substituting it in the syspref. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #6 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Well, I try to see how to proceed with C4::Scrubber and how it had been already used in other koha scripts like opac-tags.pl but I don't really get how to adapt it to the present case. However, if it's a question of sanitizing the $query_kw string before substitution, you 'll note that the regexp used to extract keywords does it since it keeps only alphanumeric characters (plus -): To pick your example, it goes like this : my $query_kw='<script type="text/javascript" src="http://link/to/evil.js"></script>'; then after theese lines : my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g); my $query_kw=join('+',@query_kw); the output to be substituted will be : my $query_kw='script+type+text+javascript+src+link+to+evil+js+script' may be, that could do the trick anyway ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Francois Charbonnier <francois.charbonnier@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |francois.charbonnier@biblib | |re.com --- Comment #7 from Francois Charbonnier <francois.charbonnier@biblibre.com> --- The patch does not apply : OPACNoResults, add keyword to search string Apply? [yn] y Applying: OPACNoResult, Add keyword to query string Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref Auto-merging opac/opac-search.pl CONFLICT (content): Merge conflict in opac/opac-search.pl Failed to merge in the changes. Patch failed at 0001 OPACNoResult, Add keyword to query string When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". Patch left in /tmp/OPACNoResults-add-keyword-to-search-string-cfak79.patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8713|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 10219 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10219&action=edit OPACNoResult, Add keyword to query string This patch add the keywords to the string entered by the user to OPACNoResultFound Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Rebased 2012-06-11 Note: Patch does not work for search terms containing umlauts like äüö. Those characters are lost from the displayed search term. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #9 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Ok,I think I see the reason why now : The \w class can match accentuated characters (as it does at lyon3) but unfortunately only if the adequate set of locales is installed on the system. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10219|0 |1 is obsolete| | --- Comment #10 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Created attachment 10253 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10253&action=edit OPACNoResultsFound, Add keyword to query string Further investigations showed that was not a question of \w class with locales but an encoding problem on the keywords extracted -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, but I think should be "needs signoff" for the improved patch. Thx for fixing it! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #12 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Do you mean I declared "Signed Off" status instead of "Needs Signoff" ? If so, I'm sorry. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #13 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #14 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- (In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #15 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- (In reply to comment #14)
(In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ?
asflfsjsfja (no, that was not a typo) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #16 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- (In reply to comment #15)
(In reply to comment #14)
(In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ?
asflfsjsfja (no, that was not a typo)
Thanks for the keyword but what was your full query (the one you put in OPACNoResultsFound) ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #17 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- (In reply to comment #16)
(In reply to comment #15)
(In reply to comment #14)
(In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ?
asflfsjsfja (no, that was not a typo)
Thanks for the keyword but what was your full query (the one you put in OPACNoResultsFound) ?
Sorry, I thought you meant the query I entered into Koha. I tried it with the following in OPACNoResultsFound: Search elsewhere: <a href="www.google.com/?q={QUERY_KW}">Google</a> for {QUERY_KW}. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #18 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- (In reply to comment #15)
(In reply to comment #14)
(In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ?
asflfsjsfja (no, that was not a typo)
Thanks for the keyword but what was your full query (the one you put in OPACNoResultsFound) ?(In reply to comment #17)
(In reply to comment #16)
(In reply to comment #15)
(In reply to comment #14)
(In reply to comment #13)
I just tested, and this patch does not work for me. Adding {QUERY_KW} to OPACNoResultsFound does not change the output at all (without this patch, the text {QUERY_KW} showed up).
strange... it works perfectly on our system, could you mention the query you had tested in OPACNoResultsFound and the keywords used ?
asflfsjsfja (no, that was not a typo)
Thanks for the keyword but what was your full query (the one you put in OPACNoResultsFound) ?
Sorry, I thought you meant the query I entered into Koha. I tried it with the following in OPACNoResultsFound: Search elsewhere: <a href="www.google.com/?q={QUERY_KW}">Google</a> for {QUERY_KW}.
Your url and keyword works on our system, the substitution is done : www.google.com/?q=asflfsjsfja I have no idea why it doesn't on your system. But I noted another point to be fixed : without the http mention in href attribute (href="http://www.google...) the address is searched in the web directory of koha. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi, I retested this on my system and it works nicely - could it be some kind of configuration issue? I tried: - simple keyword searches - searches from the advanced search page with different indexes - Umlaut searches The content of my system preference is: Something {QUERY_KW} -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #20 from Jonathan Druart <jonathan.druart@biblibre.com> --- "It works for me" But (qa comment): it is useless to generate $query_kw if the syspref does not match {QUERY_KW}, please use if( $var =~ m/{QUERY_KW}/ ). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10253|0 |1 is obsolete| | --- Comment #21 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Created attachment 12773 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12773&action=edit OPACNoResult Add keyword to query string patch redone according to your suggestion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12773|0 |1 is obsolete| | --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 14236 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14236&action=edit [SIGNED-OFF] OPACNoResult, Add keyword to query string When search failed, this patch gets the keyword(s) and add them to the string entered by the user to OPACNoResultFound http://bugs.koha-community.org/show_bug.cgi?id=7620 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Tested by setting OPACNoResultsFound to 'Search elsewhere: <a href="http://www.google.com/?q={QUERY_KW}">Google</a> for {QUERY_KW}' -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|koha.sekjal@gmail.com |jonathan.druart@biblibre.co | |m --- Comment #23 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: Now it is ok for me. Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14236|0 |1 is obsolete| | --- Comment #24 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 14240 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14240&action=edit OPACNoResult, Add keyword to query string When search failed, this patch gets the keyword(s) and add them to the string entered by the user to OPACNoResultFound http://bugs.koha-community.org/show_bug.cgi?id=7620 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7620 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #25 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. As a reminder for future patches, please be sure to include the bug number in the patch subject (first line of the commit message) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org