Bug 1047

Summary: Punctuation in site names breaks Edit/Delete z39.50 server administration
Product: Koha Reporter: Chris Cormack <chris>
Component: Z39.50 / SRU / OpenSearch ServersAssignee: Isaac Brodsky <isaacbrodsky>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P2 CC: fridolin.somers, gmcharlt, isaacbrodsky, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Patch to correct query escaping on Z39.50 server list
[SIGNED-OFF] Bug 1047 - Punctuation in site names breaks Edit/Delete z39.50 server administration
Bug 1047 - Punctuation in site names breaks Edit/Delete z39.50 server administration

Description Chris Cormack 2010-05-20 23:38:15 UTC


---- Reported by marc@happyjoy.com 2006-03-04 04:36:36 ----

Regarding "Add Z39.50 Server" in "System Administration"

When you "add" a server and enter a site name that contains a comma "," or a
dash "-" then later that server can not be deleted or edited.

A check of the z3950 log suggests the server entry appears work however.

E.g. a site name of "UNIVERSITY OF BC, LAW LIB" will cause this problem, but
"UNIVERSITY OF BC LAW LIB" will not.

Only tested with "," and "-", suspect that other punctuation may cause same problem.

Work around: Do not use punctuation when naming your z3950 servers.



---- Additional Comments From jmf@kados.org 2006-08-03 16:02:57 ----

Still a bug in rel_2_2



--- Bug imported by chris@bigballofwax.co.nz 2010-05-20 23:38 UTC  ---

This bug was previously known as _bug_ 1047 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=1047

Unknown operating system Linux - Debian. Setting to default OS "All".
Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was marc@happyjoy.com.
The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, gmcharlt@gmail.com.
   Previous assignee was jmf@kados.org.

Comment 1 Isaac Brodsky 2013-03-07 16:08:30 UTC
Reopening: I'm experiencing this issue with Koha 3.08 on Debian. I entered a Z39.50 server name containing an ampersand and system administration does not seem to be able to handle it. (Edit & delete break as described, searching on server seems to work fine.)
Comment 2 Owen Leonard 2013-03-25 15:26:43 UTC
This bug affects master as of 3.12 beta1
Comment 3 Katrin Fischer 2013-12-05 22:41:48 UTC
I tested this with the example "UNIVERSITY OF BC, LAW LIB" in current master (3.15) and it works nicely. Deleting and editing is no problem.
Comment 4 Owen Leonard 2013-12-10 15:41:54 UTC
It doesn't work if you use an &
Comment 5 Isaac Brodsky 2014-01-26 23:40:57 UTC
The problem exists because the name of the Z39.50 server is not escaped in the query string to bring up the edit/delete pages. This appears to be a bug with the "|url" Template filter, but I cannot find where that is defined.
Comment 6 Isaac Brodsky 2014-02-26 18:57:27 UTC
Replacing |url with |uri fixes this issue. I will submit a patch shortly.
Comment 7 Isaac Brodsky 2014-02-27 15:23:24 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2014-02-27 15:40:08 UTC Comment hidden (obsolete)
Comment 9 Marcel de Rooy 2014-03-12 13:23:32 UTC
Created attachment 26174 [details] [review]
Bug 1047 - Punctuation in site names breaks Edit/Delete z39.50 server administration

The template used to show the Z39.50 server administration page had a bug
that caused it to not correctly escape generated query strings. Because
the Z39.50 server name is used to lookup the server in order to edit or delete
it, when the server name is not passed correctly in the query string, it is
impossible to bring up the edit or delete forms (without manually entering
the escaped string.)

This patch corrects which template is filter used to escape those query strings.

To test:
(1) Login to intranet, go to Administration -> Z39.50 servers
(2) Select "New Z3.50 Server". Enter a server name that contains an ampersand (&)
    e.g.: "FOO & BAR". Enter other details and submit. Click OK to confirmation message.
(3) In the server list, click on the server name, the "Edit" or "Delete" buttons
    for the server.

The correct and full server details should be brought up.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Galen Charlton 2014-03-12 14:58:05 UTC
Pushed to master.  This appears to be your first patch accepted into Koha master.  Congratulations, Isaac!
Comment 11 Fridolin Somers 2014-06-04 09:38:43 UTC
Pushed to 3.14.x, will be in 3.14.08
Comment 12 Fridolin Somers 2014-06-04 09:39:31 UTC
Look here for the different between uri and url in TT :
http://template-toolkit.org/docs/manual/Filters.html#section_uri