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

--- Comment #35 from Paul Derscheid <[email protected]> ---
Thanks Eric, your report led me to a data-loss issue in the batch workflow.

I ran a comprehensive test covering single-item and batch editing, both
preference values, validation, restricted editing, linked and unlinked items,
and both modal choices.

To investigate the batch failure, I captured the request sent after choosing
“Edit serial issues.” It contained the correct item numbers, linked serial IDs,
op=cud-action, and edit-serial-issues=1. The batch job was enqueued and
finished successfully, initially applying the requested branch changes to all
three items.

After saving the serial issues, SQL showed that only the linked items had
reverted to Centerville. The unlinked item retained the batch change. This
established that the batch job worked, but the subsequent serial edit overwrote
its results.

There were two underlying problems:

1. The serial issue editor opened immediately after the asynchronous batch job
was enqueued. It could therefore load stale item values before the job
completed.
2. PrepareItemrecordDisplay replaced existing branch values with the logged-in
or subscription branch. One branch lookup also passed the complete subfield
hash instead of the subfield code.

Because serials-edit.pl submits complete linked item records through
ModItemFromMarc, saving the issues wrote those stale/default values back over
the completed batch changes.

The QA follow-up now:

- Displays job progress and opens the serial issue editor only after the batch
job finishes.
- Preserves existing home and holding libraries when preparing an existing
item.
- Continues applying branch defaults to new items.
- Adds regression tests for existing and new item branch handling.

After the fix, the complete functional test plan passed. I batch-changed three
items to Springfield, edited and saved the two linked serial issues, and
verified with SQL that all three items retained SPL for both branch fields.

prove t/db_dependent/Items.t also passes.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to