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

--- Comment #3 from babar junaid <[email protected]> ---
Created attachment 210877
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210877&action=edit
Bug 39275: Do not allow merging records before the merged record has loaded

Bug 39275: Do not allow merging records before the merged record has loaded

The merged record shown on the right of Merge records is built by
merge_ajax.pl after the page has loaded. Merge could be clicked before
that answered: check_mandatory() then saw an empty tagslib, so no check
ran, and the form posted whatever the half-built page held (every field
of both records, or almost nothing). Koha reported "The merge was
successful." and deleted the other record.

The Merge button now starts disabled and is enabled once the merged record
has been built; the submit handler also refuses while it is not ready
(pressing Enter in "Fields to display in report"), and a failed load says
so instead of leaving a half-built form.

Test plan:
1. Cataloging search, select two records, Merge selected, choose the
   reference record, Next.
2. To make the race reliable, block merge_ajax.pl in the browser
   developer tools (Network > Block request URL), then reload the page.
3. Click Merge: the merge "succeeds", the kept record is wrong and the
   other is deleted (do this on test data).
4. Apply the patch, repeat 1-2.
5. The Merge button is disabled; pressing Enter in "Fields to display in
   report" shows "The merged record has not finished loading...";
   an alert says the merged record could not be loaded.
6. Unblock merge_ajax.pl, reload: the button is enabled when the record
   is shown and the merge works as before.

Sponsored-by: Koha Solutions

-- 
You are receiving this mail because:
You are the assignee for the bug.
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