Bug 26781 - Marc Modification Templates treat subfield 0 and no subfield set
Summary: Marc Modification Templates treat subfield 0 and no subfield set
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 26894
  Show dependency treegraph
 
Reported: 2020-10-22 10:47 UTC by Nick Clemens
Modified: 2020-11-17 04:43 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06


Attachments
Bug 26781: Check for subfield defined rather than truth (2.69 KB, patch)
2020-10-22 11:01 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26781: Check for subfield defined rather than truth (2.74 KB, patch)
2020-10-24 22:02 UTC, Chris Cormack
Details | Diff | Splinter Review
k (2.86 KB, patch)
2020-10-25 00:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26781: Check for subfield defined rather than truth (2.80 KB, patch)
2020-10-25 00:29 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26781: Check for subfield defined rather than truth (2.84 KB, patch)
2020-10-25 21:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26781: (follow-up) Adjust tests as fields are no longer completely removed (1.19 KB, patch)
2020-11-02 11:24 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-10-22 10:47:38 UTC
To recreate:
1 - Have a record with 100$0 defined
2 - Define a Marc Modification template:
    Delete field 100$0
3 - Perform Batch record modification, enter the record above in the list of records
4 - Preview the MARC
5 - Note the entire 100 field has been deleted
Comment 1 Nick Clemens 2020-10-22 11:01:44 UTC
Created attachment 112164 [details] [review]
Bug 26781: Check for subfield defined rather than truth

To recreate:
 1 - Have a record with 100$0 defined
 2 - Define a Marc Modification template:
    Delete field 100$0
 3 - Perform Batch record modification, enter the record above in the list of records
 4 - Preview the MARC
 5 - Note the entire 100 field has been deleted, don't modify the record
 6 - Apply patch
 7 - Restart all the things
 8 - Test the modification again
 9 - This time the preview confirms only the subfield 0 deleted
10 - Modify the record
11 - Confirm the record is correctly updated
Comment 2 Chris Cormack 2020-10-24 22:02:53 UTC
Created attachment 112409 [details] [review]
Bug 26781: Check for subfield defined rather than truth

To recreate:
 1 - Have a record with 100$0 defined
 2 - Define a Marc Modification template:
    Delete field 100$0
 3 - Perform Batch record modification, enter the record above in the list of records
 4 - Preview the MARC
 5 - Note the entire 100 field has been deleted, don't modify the record
 6 - Apply patch
 7 - Restart all the things
 8 - Test the modification again
 9 - This time the preview confirms only the subfield 0 deleted
10 - Modify the record
11 - Confirm the record is correctly updated

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 3 Katrin Fischer 2020-10-25 00:28:25 UTC
Created attachment 112433 [details] [review]
k
Comment 4 Katrin Fischer 2020-10-25 00:29:01 UTC
Created attachment 112434 [details] [review]
Bug 26781: Check for subfield defined rather than truth

To recreate:
 1 - Have a record with 100$0 defined
 2 - Define a Marc Modification template:
    Delete field 100$0
 3 - Perform Batch record modification, enter the record above in the list of records
 4 - Preview the MARC
 5 - Note the entire 100 field has been deleted, don't modify the record
 6 - Apply patch
 7 - Restart all the things
 8 - Test the modification again
 9 - This time the preview confirms only the subfield 0 deleted
10 - Modify the record
11 - Confirm the record is correctly updated

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-10-25 21:57:53 UTC
Created attachment 112488 [details] [review]
Bug 26781: Check for subfield defined rather than truth

To recreate:
 1 - Have a record with 100$0 defined
 2 - Define a Marc Modification template:
    Delete field 100$0
 3 - Perform Batch record modification, enter the record above in the list of records
 4 - Preview the MARC
 5 - Note the entire 100 field has been deleted, don't modify the record
 6 - Apply patch
 7 - Restart all the things
 8 - Test the modification again
 9 - This time the preview confirms only the subfield 0 deleted
10 - Modify the record
11 - Confirm the record is correctly updated

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: Fix typo ony vs only
Comment 6 Jonathan Druart 2020-10-25 23:10:05 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Jonathan Druart 2020-11-02 09:05:13 UTC
There is a failing test:

t/db_dependent/MarcModificationTemplates.t .. 1/126 
#   Failed test '100$0 has been deleted, added back, updated, moved to 600$0, and copied back to 100$0; finally, 245$0 has been copied and replaced to 700$0'
#   at t/db_dependent/MarcModificationTemplates.t line 799.
#     Structures begin differing at:
#          $got->{_fields}[2]{_ind1} = '1'
#     $expected->{_fields}[2]{_ind1} = ' '
# Looks like you failed 1 test of 126.

Please fix ASAP.
Comment 8 Nick Clemens 2020-11-02 11:24:24 UTC
Created attachment 112826 [details] [review]
Bug 26781: (follow-up) Adjust tests as fields are no longer completely removed
Comment 9 Jonathan Druart 2020-11-02 12:51:44 UTC
(In reply to Nick Clemens from comment #8)
> Created attachment 112826 [details] [review] [review]
> Bug 26781: (follow-up) Adjust tests as fields are no longer completely
> removed

Pushed to master.
Comment 10 Lucas Gass 2020-11-13 20:52:29 UTC
backported to 20.05.x for 20.05.06
Comment 11 Aleisha Amohia 2020-11-17 04:43:17 UTC
doesn't apply cleanly on 19.11.x, not backported