Bug 36949 - Cataloguing error links don't scroll to correct position when tab changes
Summary: Cataloguing error links don't scroll to correct position when tab changes
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Katariina Pohto
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-23 14:17 UTC by Katariina Pohto
Modified: 2025-06-02 20:46 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Screenshot of the error message links on cataloguing/addbiblio.pl (35.33 KB, image/png)
2024-05-23 14:17 UTC, Katariina Pohto
Details
Bug 36949: Cataloguing error links don't scroll to correct position when tab changes (2.30 KB, patch)
2024-05-23 14:38 UTC, Katariina Pohto
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katariina Pohto 2024-05-23 14:17:02 UTC
Created attachment 167113 [details]
Screenshot of the error message links on cataloguing/addbiblio.pl

During cataloging if there are errors in the marc fields when trying to save a record, the error links don't always scroll to the correct field position. This happens when the link directs to an inactive tab and has to scroll over many fields. (Earlier the tab change was also broken but got fixed in 23.11.)

Prerequisites for testing:
1. Make sure there are enough editable fields in the biblio framework you'll use for testing to require plenty of scrolling.
2. Make sure that there are enough required fields in the biblio framework to trigger error messages and getting to these fields requires scrolling.

Testing:
1. Go to cataloging and Add record.
2. Try to save the record without filling in the required fields.
3. Click -> Go to field link that directs to an inactive tab.
4. Note that while the tab changes correctly, the window doesn't quite scroll far enough to the correct field.
5. Try also clicking the link to an active tab, and note that scrolling works fine.
Comment 1 Katariina Pohto 2024-05-23 14:38:44 UTC
Created attachment 167116 [details] [review]
Bug 36949: Cataloguing error links don't scroll to correct position when tab changes

This patch adds a small delay between tab change and finding the new coordinates, and seems to fix the issue.

It might not be the best fix for this but it should show that problem most likely lies with the tab change reorganizing the page, and the coordinates misfiring because the page-loading is not done immediately.

Test plan:
1. Reproduce the bug by following the plan on 1st post
2. Apply patch and clear cache
3. Go back and try again to save a new biblio without required information
4. Click an error link that directs to inactive tab, and previously didn't scroll to the correct position
5. Note that the window now scrolls to the correct position
Comment 2 David Nind 2024-05-24 23:49:21 UTC
I had a go at testing using koha-testing-docker (KTD) on main, but I couldn't replicate the issue.

I tried with several browsers, with the cache cleared (Firefox Developer Edition, Chromium, and Google Chrome).

I also tried using UNIMARC, mainly as it has a lot of mandatory fields and lots of tags and subfields in most sections.

In all cases, it scrolled down to the field with the error for active and inactive sections.

I'll leave to see if anyone else can replicate.
Comment 3 Laura Escamilla 2024-05-31 17:28:26 UTC
I have also tested this in several browsers and have not been able to recreate the bug. In all cases, as David mentioned, clicking on the 'Go to field' properly scrolled down to the field with the error for active and inactive sections.