[Bug 7520] New: json script to return item types
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7520 Bug #: 7520 Summary: json script to return item types Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC AssignedTo: oleonard@myacpl.org ReportedBy: srdjan@catalyst.net.nz QAContact: koha.sekjal@gmail.com Small script to return list of available item types, useful for building item type lists in custom code, eg provided in sysprefs -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|json script to return item |json script to return |types |advanced search types -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff AssignedTo|oleonard@myacpl.org |srdjan@catalyst.net.nz --- Comment #1 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-10 08:07:27 UTC --- Created attachment 7556 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7556 patch Correction, not item types but advanced search types, which could be collection codes or item types -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- 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=7520 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |frederic@tamil.fr --- Comment #2 from Frédéric Demians <frederic@tamil.fr> 2012-02-10 08:18:17 UTC --- When calling: cgi-bin/koha/advanced_search_types.json identification is required. You have to log in to the OPAC as a Koha patron. I don't think it's normal. Is it? -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #3 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-12 23:09:53 UTC --- If the opac requires authentication user must be logged in and auth cookie sent in order to get a response. So if you just put the url in your browser it won't work. However, if you visit the login page first and log in, it should be fine afterwards. -- 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=7520 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #4 from Frédéric Demians <frederic@tamil.fr> 2012-02-13 06:19:32 UTC --- (In reply to comment #3)
If the opac requires authentication user must be logged in and auth cookie sent in order to get a response. So if you just put the url in your browser it won't work. However, if you visit the login page first and log in, it should be fine afterwards.
The OPAC doesn't require authentication except for accessing pages displaying the borrower account. I now how to get a JSON result from your script, and I get a valid response. But since the returned data doesn't contain any confidential information (you find them on OPAC advanced search page which is public), I don't think authentication should be required. -- 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=7520 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> 2012-02-13 06:29:24 UTC --- It should only require authentication when opacpublic is turned off. (There is a syspref to make the whole opac require authentication, this should of course obey that) But if the opac is public then yes, I don't see the need for auth. Maybe it isn't checking this syspref correctly? -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7556|0 |1 is obsolete| | --- Comment #6 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-13 07:22:07 UTC --- Created attachment 7605 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7605 patch Checking for OpacPublic now -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7605|0 |1 is obsolete| | --- Comment #7 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-13 07:29:29 UTC --- Created attachment 7606 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7606 patch -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |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=7520 --- Comment #8 from Frédéric Demians <frederic@tamil.fr> 2012-02-13 07:53:32 UTC --- Thanks Chris for OpacPublic syspref. There is a little typo. This line: checkauth($input, !C4::Context->preference("OpacPublic"), {}, "opac"); should be: checkauth($input, C4::Context->preference("OpacPublic"), {}, "opac"); IF the OPAC is public THEN no auth check. -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7606|0 |1 is obsolete| | --- Comment #9 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-13 08:02:36 UTC --- Created attachment 7611 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7611 patch Correct, sorry about that, thanks for spotting. -- 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=7520 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7611|0 |1 is obsolete| | --- Comment #10 from Frédéric Demians <frederic@tamil.fr> 2012-02-13 08:14:11 UTC --- Created attachment 7613 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7613 Signed-off patch -- 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=7520 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=7520 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |paul.poulain@biblibre.com --- Comment #11 from Paul Poulain <paul.poulain@biblibre.com> 2012-02-21 13:52:33 UTC --- QA comment * the code itself is OK, use JSON, that is already a Koha dependancy * perlcritic compliant 2 things that make me mark this patch "failed QA" though: * a unit test for this script is needed (and should be easy to write) * an example of how/where to use this would be cool. A question: this script can be considered as a webservice right ? why not putting it into a specific directory where we could put this kind of script ? I don't request it, just suggesting. -- 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=7520 --- Comment #12 from Srdjan Jankovic <srdjan@catalyst.net.nz> 2012-02-22 06:19:28 UTC ---
* a unit test for this script is needed (and should be easy to write)
I have no idea how to do that. Can you please point me to an example of a koha test for a CGI request handler. In general, I have huge problems running Koha test suite. Is there a wiki page or similar on how to run tests when developing?
* an example of how/where to use this would be cool.
Sure. In the code?
A question: this script can be considered as a webservice right ? why not putting it into a specific directory where we could put this kind of script ? I don't request it, just suggesting.
I wanted to do that myself, but found similar service(s) in the same place. So I'm open to suggestions. I feel adventurous already for naming it .json -- 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=7520 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7520 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #13 from M. Tompsett <mtompset@hotmail.com> --- *ping* Perhaps this could tie into the REST API development? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org