Format 'dc' could be accepted by C4::Record::marc2dcxml since there is a xslt. I saw this error in my log: The format argument (dc) not accepted. Please pass a valid format (oaidc, srwdc, or rdfdc) at opac/opac-export.pl line 80. [Probably from Googlebot or so.] I would prefer to see 'Format not supported' rather than 'Internal server error'. We can achieve that by using the same regex in opac-export.pl and Record.pm. Note that I skip catalogue/export.pl here, since it has no fallback at the end, and will not be called by bots.
Created attachment 71018 [details] [review] Bug 20097: Use same regex in marc2dcxml and opac-export This regex allows: dc, oaidc, srwdc, and rdfdc. Test plan: [1] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=dc [2] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=oaidc [3] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=nodc. This one should trigger a not-supported message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Hey Marcel, When I tried to get to the links you put out, I got to an Error 404 in Koha (after changing the server and bibnumbers of course), with and without the patch. I accessed the links directly, do I need to access your through another page?
(In reply to Maksim Sen from comment #2) > Hey Marcel, > > When I tried to get to the links you put out, I got to an Error 404 in Koha > (after changing the server and bibnumbers of course), with and without the > patch. > > I accessed the links directly, do I need to access your through another page? Thx for testing, Maksim. Testing these links should be enough. They still work for me. Please paste the URL you tried.
Created attachment 72528 [details] [review] Bug 20097: Follow-up with a unit test kshell prove -v t/db_dependent/Record.t
I tested these on a reset_all, kohadevbox. localhost:8080/cgi-bin/koha/opac-export.pl?bib=1&op=export&format=dc localhost:8080/cgi-bin/koha/opac-export.pl?bib=1&op=export&format=oaidc localhost:8080/cgi-bin/koha/opac-export.pl?bib=1&op=export&format=srwdc localhost:8080/cgi-bin/koha/opac-export.pl?bib=1&op=export&format=rdfdc localhost:8080/cgi-bin/koha/opac-export.pl?bib=1&op=export&format=nodc
Created attachment 72529 [details] [review] Bug 20097: Use same regex in marc2dcxml and opac-export This regex allows: dc, oaidc, srwdc, and rdfdc. Test plan: [1] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=dc [2] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=oaidc [3] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=nodc. This one should trigger a not-supported message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 72530 [details] [review] Bug 20097: Follow-up with a unit test kshell prove -v t/db_dependent/Record.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 72537 [details] [review] Bug 20097: Use same regex in marc2dcxml and opac-export This regex allows: dc, oaidc, srwdc, and rdfdc. Test plan: [1] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=dc [2] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=oaidc [3] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=nodc. This one should trigger a not-supported message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 72538 [details] [review] Bug 20097: Follow-up with a unit test kshell prove -v t/db_dependent/Record.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Pushed to master for 18.05, thanks to everybody involved!