Bug 15773

Summary: Checkboxes do not work correctly when creating a new subfield for an authority framework
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: System AdministrationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: bgkriegel, brendan, f.demians, gmcharlt, hector.hecaxmmx, julian.maurice, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14308
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15773: Fix and standardise checkboxes code in framework
[SIGNED-OFF]Bug 15773: Fix and standardise checkboxes code in framework
Bug 15773: Fix and standardise checkboxes code in framework
Bug 15843: Move MARC subfields structure JavaScript into separate file
Bug 15773: Fix and standardise checkboxes code in framework
[PASSED QA] Bug 15773: Fix and standardise checkboxes code in framework

Description Jonathan Druart 2016-02-09 17:01:51 UTC
When creating a new subfield for an authority framework, the checkboxes don't behave as they should.
If you click on the 'repeatable', 'mandatory' or 'is url' checkbox's label, the checkbox from the second tab will be checked/unchecked.
This is caused by a non-unique id of the input element.
Comment 1 Jonathan Druart 2016-02-09 17:08:34 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-02-09 17:36:27 UTC
Hi Jonathan

Patch fail in merge step.

I've tried to apply 15771 on top but fails, applied alone 15773 but fails me too.

Applying: Bug 15773: Fix and standardise checkboxes code in framework
fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 15773: Fix and standardise checkboxes code in framework
Comment 3 Héctor Eduardo Castro Avalos 2016-02-09 17:47:51 UTC
(In reply to Héctor Eduardo Castro Avalos from comment #2)
> Hi Jonathan
> 
> Patch fail in merge step.
> 
> I've tried to apply 15771 on top but fails, applied alone 15773 but fails me
> too.
> 

Ok needs 15754
Comment 4 Héctor Eduardo Castro Avalos 2016-02-09 19:29:55 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-02-18 11:31:13 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-02-18 11:31:44 UTC
Rebased and removed deps on bug 15754 and bug 15771.
Comment 7 Jonathan Druart 2016-02-18 11:36:16 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-02-18 11:37:39 UTC
Sorry for the noise, wrong bug report.
Comment 9 Katrin Fischer 2016-03-20 17:12:43 UTC
Hi Jonathan,
can you please rebase?

CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt
Comment 10 Jonathan Druart 2016-03-21 14:41:22 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2016-03-22 22:43:51 UTC
Created attachment 49417 [details] [review]
[PASSED QA] Bug 15773: Fix and standardise checkboxes code in framework

When creating a new subfield for an authority framework, the checkboxes
don't behave as they should.
If you click on the 'repeatable', 'mandatory' or 'is url' checkbox's
label, the checkbox from the second tab will be checked/unchecked.
This is caused by a non-unique id of the input element.

I have found this bug when working on the removal of CGI::checkbox in
both admin/auth_subfields_structure.pl and
admin/marc_subfields_structure.pl scripts.

This patch remove the use of CGI::checkbox as well as the generation of
html code from these 2 pl scripts (which should be avoided).
The code these scripts are now pretty similar.

Test plan:
Add/modify/remove subfield for a MARC framework and an Authority
framework.
Use as many field as possible and confirm that the values are correctly
inserted/displayed.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Brendan Gallagher 2016-03-23 01:07:25 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 13 Julian Maurice 2016-04-06 14:47:58 UTC
Patch pushed to 3.22.x, will be in 3.22.6
Comment 14 Frédéric Demians 2016-04-27 15:39:40 UTC
Pushed to 3.20.x, will be in 3.20.11.
Comment 15 Owen Leonard 2016-08-09 12:46:28 UTC
*** Bug 14308 has been marked as a duplicate of this bug. ***
Comment 16 Jonathan Druart 2018-06-20 15:50:22 UTC
*** Bug 15771 has been marked as a duplicate of this bug. ***