[Koha-bugs] [Bug 24480] Fields added with MARC modifications templates are not added in an ordered way

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 15 22:21:23 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24480

--- Comment #36 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 155716
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155716&action=edit
Bug 24480: (follow-up) Shift new fields into array and add after all are copied

The updated code removed the pushing of fields to an array - this caused a bug.
When multiple fields were copied and replaced and there were more fields added
than existed originally we were adding the new field to the end, then removing
the first occurence of the original field. If we tried to move 2 650 fields to
651 and the record had no 651 we would:
- Delete the first 651, there were none, so nothing happened
- Take the first 650, add it to the end of the 651 group (there were none, so
it became the first 651)
- Delete the first 651, which was the field we just copied
- Take the second 650 and add it to the end of the 651 group (whihc had none,
because we deleted it)

I re-add the line, but do as suggesed by Phil and reverse the order (unshift vs
push)

To test:
1 - Apply other patches
2 - prove -v t/SimpleMARC.t
3 - It fails
4 - Apply this patch
5 - prove -v t/SimpleMARC.t
6 - It still fails, but more tests pass (there's another patch to follow)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list