Bug 18706

Summary: subfields to delete not disabled anymore in batch item modification
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: ToolsAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, josef.moravec, katrin.fischer, mtj
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18707
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13501    
Bug Blocks: 18710    
Attachments: Bug 18706 - subfields to delete not disabled anymore in batch item modification
Bug 18706 - Remove useless Javascript
[SIGNED-OFF] Bug 18706 - subfields to delete not disabled anymore in batch item modification
[SIGNED-OFF] Bug 18706 - Remove useless Javascript
Bug 18706 - subfields to delete not disabled anymore in batch item modification
Bug 18706 - Remove useless Javascript

Description Fridolin Somers 2017-05-31 13:58:46 UTC
In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().
Comment 1 Fridolin Somers 2017-05-31 14:14:48 UTC
Created attachment 63864 [details] [review]
Bug 18706 - subfields to delete not disabled anymore in batch item modification

In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().

This patch replaces with $(this).parent().find("[name='field_value']").

Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted
Comment 2 Fridolin Somers 2017-05-31 14:15:04 UTC
Created attachment 63865 [details] [review]
Bug 18706 - Remove useless Javascript

Whe checking a subfield to be deleted, the code
  $(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
  <input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />
Comment 3 Josef Moravec 2017-05-31 19:58:00 UTC
Created attachment 63890 [details] [review]
[SIGNED-OFF] Bug 18706 - subfields to delete not disabled anymore in batch item modification

In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().

This patch replaces with $(this).parent().find("[name='field_value']").

Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Josef Moravec 2017-05-31 19:58:04 UTC
Created attachment 63891 [details] [review]
[SIGNED-OFF] Bug 18706 - Remove useless Javascript

Whe checking a subfield to be deleted, the code
  $(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
  <input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Jonathan Druart 2017-06-09 15:28:07 UTC
Created attachment 64152 [details] [review]
Bug 18706 - subfields to delete not disabled anymore in batch item modification

In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().

This patch replaces with $(this).parent().find("[name='field_value']").

Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-06-09 15:28:10 UTC
Created attachment 64153 [details] [review]
Bug 18706 - Remove useless Javascript

Whe checking a subfield to be deleted, the code
  $(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
  <input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2017-06-09 15:47:46 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-06-12 10:48:19 UTC
Pushed to 17.05.x, will be in 17.05.01
Comment 9 Katrin Fischer 2017-06-13 06:03:56 UTC
This patch has been pushed to 16.11.x and will be in 16.11.09.

Please sign-off on bug 18710!
Comment 10 Mason James 2017-07-31 11:22:04 UTC
Pushed to 16.05.x, for 16.05.15 release