[Bug 23925] New: Value builder plugin to check ISBN validity
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Bug ID: 23925 Summary: Value builder plugin to check ISBN validity Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: pasi.kallinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |pasi.kallinen@koha-suomi.fi |ity.org | --- Comment #1 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 94861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94861&action=edit Bug 23925: Value builder plugin to check ISBN validity This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=906 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |bgkriegel@gmail.com --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Sorry, needs rebase CONFLICT (content): Merge conflict in koha-tmpl/intranet-CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arouss1980@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94861|0 |1 is obsolete| | --- Comment #3 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 99977 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99977&action=edit Bug 23925: Value builder plugin to check ISBN validity This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Devinim <kohadevinim@devinim.com.tr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Devinim <kohadevinim@devinim.com.tr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99977|0 |1 is obsolete| | --- Comment #4 from Devinim <kohadevinim@devinim.com.tr> --- Created attachment 100267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100267&action=edit Bug 23925: Value builder plugin to check ISBN validity This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Devinim <kohadevinim@devinim.com.tr> Nice plugin. Tested for both 13 and 10 digits ISBNs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100267|0 |1 is obsolete| | --- Comment #5 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 100296 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100296&action=edit Bug 23925: Value builder plugin to check ISBN validity This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Devinim <kohadevinim@devinim.com.tr> Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #6 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 100299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100299&action=edit incorrect display of input field when the ISBN is wrong -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #7 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 100300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100300&action=edit correct display of input field when the ISBN is wrong -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |a.roussos@dataly.gr --- Comment #8 from Andreas Roussos <a.roussos@dataly.gr> --- I've tested the plugin on both a MARC21 and a UNIMARC installation and it works fine, except for a minor hiccup in the display of the highlighted input field when the ISBN is incorrect (see attached screenshots). This is due to a couple of missing CSS classes for the HTML <input> element. I will provide a follow-up that addresses this issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #9 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 100301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100301&action=edit Bug 23925: (follow-up) Add missing CSS classes The highlighted input field for an incorrect ISBN was displayed incorrectly -- this patch fixes that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100296|0 |1 is obsolete| | Attachment #100301|0 |1 is obsolete| | --- Comment #10 from Michal Denar <black23@gmail.com> --- Created attachment 100318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100318&action=edit Bug 23925: Value builder plugin to check ISBN validity This patch adds a new value builder plugin ISBN.pl, which should be attached to field 020a. The plugin will perform a simple checksum checking when trying to save the record, and inform the user that the ISBN is illegal if the checksum doesn't match. The ISBN plugin is a test case for additional value builder plugin functionality that lets the plugins check field values and prevent saving if so desired. The example plugin has been updated with information on how to write a pre-save check function. To test: 1) Add the ISBN.pl plugin to the field 020a in MARC subfield structure admin. 2) Go to cataloguing and try to save the record, no complaints about the ISBN (Because the plugin will not complain about empty field) 3) Enter something in the 020a field and try to save, you should receive a complaint about illegal ISBN. 4) Enter a valid ISBN (eg. 978-951-1-27641-8) and try to save, there should be no complaints about the ISBN. Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Devinim <kohadevinim@devinim.com.tr> Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> Signed-off-by: Michal Denar <black23@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #11 from Michal Denar <black23@gmail.com> --- Created attachment 100319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100319&action=edit Bug 23925: (follow-up) Add missing CSS classes The highlighted input field for an incorrect ISBN was displayed incorrectly -- this patch fixes that. Signed-off-by: Michal Denar <black23@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- "Illegal ISBN" will not be translatable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #13 from Andreas Roussos <a.roussos@dataly.gr> --- (In reply to Jonathan Druart from comment #12)
"Illegal ISBN" will not be translatable. Hello, Jonathan. Can you elaborate, please? From what I can see Pasi has followed the coding guideline (JS2: Enabling translation of language strings in embedded JavaScript) and wrapped the string in the special function _(), like so:
return { funcname: id, msg: _("Illegal ISBN") }; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hi Andreas, This is not an "embedded javascript" (in .tt). With bug 21156 it is now possible to have translated string in .js, but the function is different. The correct guideline is JS5 (but make sure you read the note at the beginning). Basically you need to replace _() with __() (simple vs double underscore). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #15 from Andreas Roussos <a.roussos@dataly.gr> --- Thanks for your prompt reply, Jonathan. I tried to write a follow-up and replaced the _() with __() However, when I run: cd misc/translator && ./translate update fr-FR Then, none of the files in misc/translator/po/fr-FR-*.po contain the string "Illegal ISBN" for translation. Is this because the string is part of embedded JS in a .pl file? (cataloguing/value_builder/ISBN.pl) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23925 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Ha! Yes! I was wondering why I did not follow-up myself for such simple fix. Actually what needs to be done is: pass an error code to the template, then test it and make the string translatable from there. Does it make sense? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org