[Bug 39275] New: Merging records can destroy records if page has not fully loaded
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 Bug ID: 39275 Summary: Merging records can destroy records if page has not fully loaded Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl We just had a case where a lot of records where merged while the instance was slowed down significantly (crawlers) and the records ended up emptied out completely. As far as we can tell, this is what happened: * Select 2 records to merge from catalog or cataloguing search * Select "winner" record * On the next page, the second column with the "winner" is loaded a little after the rest of the page -> When you merge before it's loaded, the record is emptied out -> Wait until the page is fully loaded, the record will be ok. Maybe we could lock the "Merge records" button, until the page is fully loaded? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org --- Comment #1 from Phil Ringnalda <phil@chetcolibrary.org> --- Also happens with merging authority records, but at least there it says something like "We found no MARC tags in the destination record" and doesn't save an empty record. But I've always worried that it would be willing to save a half-record, if the destination partly loads and then stalls. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 dmeininger591@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmeininger591@gmail.com --- Comment #2 from dmeininger591@gmail.com --- I experienced this bug twice on March 31st 2025. The records were not particularly large, 25-40 items on each. When I merged them the MARC information was completely deleted but the item information was still there. It was easy enough to re-download the MARC record but caused a bit of panic for me at first. I will try to keep an eye on the page loading in future merges. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 --- Comment #3 from babar junaid <babarjunaid1122@gmail.com> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Needs Signoff |Failed QA --- Comment #4 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Hey Babar, thanks for the patch. For the front end the JavaScript solution is great and seems to work well. I think we should also add a guard in the script. We can keep the JS patches but I'd rather not rely only on JS to prevent data loss. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39275 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #5 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This is data loss so I'm upping the severity. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org