When you search for an editor with a simple quote in the name, the escaping fails and nothing happens.
Created attachment 63644 [details] [review] Bug 18655: correct the escaping of ' and move code toward jquery part
Created attachment 63652 [details] [review] Bug 18655: Followup
Created attachment 63653 [details] [review] Bug 18655: Correct the "chose" link - Link 'chose' is now a button. - It doesn't call directly javascript anymore (use of listener). - field to load stored in html on the page (less escaping needed).
Maybe someone familiar with the plugin could test? It sounds like a search within the plugin which contains ' should fail without the patch.
Hi Baptiste, I was looking to test this patch, could you provide a Test Plan ? I can't seem to able to reproduce the bug within the unimarc plugin 210c, with or without the patch I can search for an authority with a ' in the name. The choose button doesn't seem appear for me at all (can't find it hidden in dev tools either).
(In reply to Simon Pouchol from comment #5) > Hi Baptiste, > I was looking to test this patch, could you provide a Test Plan ? > I can't seem to able to reproduce the bug within the unimarc plugin 210c, > with or without the patch I can search for an authority with a ' in the name. > The choose button doesn't seem appear for me at all (can't find it hidden in > dev tools either). I continue Baptiste's job. You need an existing authority with a ' in its name, like "L'histoire". When trying to choose this authority it fails. Btw I think that writing JS inside HTML tags is now prohibited.
Patch doesn't apply anymore, because of what looks like an added MACRO jsinclude BLOCK: > CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt
Javascript has been moved to the bottom of all the tt in intranet - that's probably causing the conflict.
Created attachment 76168 [details] [review] Bug 18655: Correct the choose link in unimarc_field_210c value builder - Link 'choose' is now a button. - It doesn't call directly javascript anymore (use of listener). - field to load stored in html on the page (less escaping needed). Test plan : 1) Use UNIMARC catalog 2) Define unimarc_field_210c value builder on 210$c 3) Define an autority type EDITORS with heading on 200$b 4) Create an autority of this type with a single quote in heading, ie : l'avenir 5) Index this new autority 6) Edit a biblio record and launch 210$c value builder 7) Search for new autority 8) Click on 'Choose' => Heading should be pasted in 210$c
Created attachment 78710 [details] [review] Bug 18655: Correct the choose link in unimarc_field_210c value builder - Link 'choose' is now a button. - It doesn't call directly javascript anymore (use of listener). - field to load stored in html on the page (less escaping needed). Test plan : 1) Use UNIMARC catalog 2) Define unimarc_field_210c value builder on 210$c 3) Define an autority type EDITORS with heading on 200$b 4) Create an autority of this type with a single quote in heading, ie : l'avenir 5) Index this new autority 6) Edit a biblio record and launch 210$c value builder 7) Search for new autority 8) Click on 'Choose' => Heading should be pasted in 210$c
Patch tested with a sandbox, by David Nind <david@davidnind.com>
Created attachment 78865 [details] [review] Bug 18655: Correct the choose link in unimarc_field_210c value builder - Link 'choose' is now a button. - It doesn't call directly javascript anymore (use of listener). - field to load stored in html on the page (less escaping needed). Test plan : 1) Use UNIMARC catalog 2) Define unimarc_field_210c value builder on 210$c 3) Define an autority type EDITORS with heading on 200$b 4) Create an autority of this type with a single quote in heading, ie : l'avenir 5) Index this new autority 6) Edit a biblio record and launch 210$c value builder 7) Search for new autority 8) Click on 'Choose' => Heading should be pasted in 210$c Signed-off-by: David Nind <david@davidnind.com>
Created attachment 80315 [details] [review] Bug 18655: Correct the choose link in unimarc_field_210c value builder - Link 'choose' is now a button. - It doesn't call directly javascript anymore (use of listener). - field to load stored in html on the page (less escaping needed). Test plan : 1) Use UNIMARC catalog 2) Define unimarc_field_210c value builder on 210$c 3) Define an autority type EDITORS with heading on 200$b 4) Create an autority of this type with a single quote in heading, ie : l'avenir 5) Index this new autority 6) Edit a biblio record and launch 210$c value builder 7) Search for new autority 8) Click on 'Choose' => Heading should be pasted in 210$c Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.05
Pushed to 17.11.x for 17.11.11