Description
Fridolin Somers
2021-08-07 01:35:04 UTC
Created attachment 123591 [details] [review] Bug 28828: (Bug 22399 follow-up) impact on value_builder/unimarc_field_4XX.tt Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong : var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); It needs one more parent. Test plan : 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Created attachment 123592 [details] [review] Bug 28828: Bug 22399 impact on value_builder/unimarc_field_4XX.tt Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong : var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); It needs one more parent. Test plan : 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Created attachment 123594 [details] [review] Bug 28828: Bug 22399 impact on value_builder/unimarc_field_4XX.tt Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong : var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); It needs one more parent. Test plan : 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Signed-off-by: David Nind <david@davidnind.com> Created attachment 123642 [details] [review] Bug 28828: (Alternate) find closest ul for valuebuilders Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong : var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); It needs one more parent. Test plan 1: 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Test plan 2: 1) Use a MARC_21 DB 2) Define plugin mnarc21_linking_section.pl on 773$t 3) Make sure 773$t and other subfields are visible in intranet/editor 4) Create a new record in basic cataloging editor 5) Click on value builder in 773$t 6) Search fro a record 7) Click on "Choose" => Without patch fields are not fileld => With patch subfields are correctly filled Looks like a second plugin is affected - I use 'closest' rather than several 'parentNode' as I think it makes the change clearer - what do you think Frido? Bug 28738 is also affected - would love some help there simplifying the JS. Created attachment 123666 [details] [review] Bug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders Find closest ul for value builders. Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong: var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); Test plan 1: 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Test plan 2: 1) Use a MARC_21 DB 2) Define plugin marc21_linking_section.pl on 773$t 3) Make sure 773$t and other subfields are visible in intranet/editor 4) Create a new record in basic cataloging editor 5) Click on value builder in 773$t 6) Search fro a record 7) Click on "Choose" => Without patch fields are not fileld => With patch subfields are correctly filled Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Hi Frido or David, could one of you have a final look here? I've chosen Nick's alternate and changed the bug title to reflect that this now fixes 2 different value builders. Created attachment 123687 [details] [review] Bug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders Find closest ul for value builders. Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong: var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); Test plan 1: 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Test plan 2: 1) Use a MARC_21 DB 2) Define plugin marc21_linking_section.pl on 773$t 3) Make sure 773$t and other subfields are visible in intranet/editor 4) Create a new record in basic cataloging editor 5) Click on value builder in 773$t 6) Search fro a record 7) Click on "Choose" => Without patch fields are not fileld => With patch subfields are correctly filled Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> (In reply to Katrin Fischer from comment #8) > Hi Frido or David, could one of you have a final look here? I've chosen > Nick's alternate and changed the bug title to reflect that this now fixes 2 > different value builders. I have run through the updated test plan and everything works as expected. Thanks a lot David! Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.03 Pushed to 20.11.x for 20.11.09 Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. *** Bug 28738 has been marked as a duplicate of this bug. *** |