Summary: | "Jump to add item form" doesn't work while editing an existing item | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Templates | Assignee: | Phil Ringnalda <phil> |
Status: | Passed QA --- | QA Contact: | Emily Lamancusa (emlam) <emily.lamancusa> |
Severity: | minor | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, emily.lamancusa, oleonard, phil |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 36320 | ||
Bug Blocks: | |||
Attachments: |
Bug 39400: "Jump to add item form" doesn't work while editing an existing item
Bug 39400: "Jump to add item form" doesn't work while editing an existing item Bug 39400: "Jump to add item form" doesn't work while editing an existing item Bug 39400: (QA follow-up) Adjust link text |
Description
Katrin Fischer
2025-03-20 18:02:06 UTC
Are your steps to reproduce: 1. Edit an existing item, and then...? The link targets the "<h2 id="additema">Add item</h2>" which only exists when you are not editing an existing item. The patch adding it expected that edit links would instead target #edititem, and added that target to links from the holdings table, but not from the Items tab (and I wouldn't be surprised if there are other edit item links, say in serials or acq). But even if your edit link targets #edititem, you still might scroll up and then you'll have a broken link pretending it will take you back to the form, which should have the same conditional that determines whether to have an additema or an edititem, [% IF op != 'cud-saveitem' %]#additema[% ELSE %]#edititem[% END %]. Or, we could just target #f since the form is always there. Not acq (which targets #edititem) or serials (which just has a Manage items link labelled Edit items), but along with the Items tab, item search, reports which show itemnumber, and batch modify items all have links to edit a particular item without a hash to scroll to the form. The link with the text shows right on top of the item table to the left when you edit any item in the catalog. I am pretty sure it's just JS. Ah, indeed it is JS because of bug 36320 comment 10, which would have left me very confused when I changed the link href to "f" and still scrolled to "additema" (or not, when there is no additema). Created attachment 179588 [details] [review] Bug 39400: "Jump to add item form" doesn't work while editing an existing item The link at the top of the item editor page to "Jump to add item form" tries to scrollIntoView the element with id="additema", but that element only exists while you are adding a new item. While you are editing an existing item, it is replaced by an element with id="edititem". Whichever element you have at the moment is always just below the form with id="f", so we can just scroll that into view instead. Test plan: 1. Without the patch, go to the details page for any bib record with at least one item, and click the Edit button on the row for an item in the holdings table. 2. You should be scrolled down to the form for editing that item 3. Scroll up to the top of the page, click the Jump to add item form link 4. You will not be scrolled back down to the form 5. Apply patch, shift+reload page 6. Now the link should scroll you back down to the form 7. Return to the biblio details page, click Edit - Manage items and verify that the Jump to add item form link still works when you are not editing an existing item 8. Click the Add multiple copies of this item button and add 30 items 9. Make sure that the link still scrolls the form into view both while you are editing an existing item, and while you are adding a new item Sponsored-by: Chetco Community Public Library Created attachment 179624 [details] [review] Bug 39400: "Jump to add item form" doesn't work while editing an existing item The link at the top of the item editor page to "Jump to add item form" tries to scrollIntoView the element with id="additema", but that element only exists while you are adding a new item. While you are editing an existing item, it is replaced by an element with id="edititem". Whichever element you have at the moment is always just below the form with id="f", so we can just scroll that into view instead. Test plan: 1. Without the patch, go to the details page for any bib record with at least one item, and click the Edit button on the row for an item in the holdings table. 2. You should be scrolled down to the form for editing that item 3. Scroll up to the top of the page, click the Jump to add item form link 4. You will not be scrolled back down to the form 5. Apply patch, shift+reload page 6. Now the link should scroll you back down to the form 7. Return to the biblio details page, click Edit - Manage items and verify that the Jump to add item form link still works when you are not editing an existing item 8. Click the Add multiple copies of this item button and add 30 items 9. Make sure that the link still scrolls the form into view both while you are editing an existing item, and while you are adding a new item Sponsored-by: Chetco Community Public Library Signed-off-by: Owen Leonard <oleonard@myacpl.org> This is a nice fix, but I have one nitpick on wording: the link text still says "Jump to add item form", even when it is actually the edit form. Is there a more general phrase we could put there? Maybe "Jump to item fields form"? How about "Item entry form" ? "Item entry" still sounds like adding a new item to me...I personally wouldn't call it "entry" if I was editing an existing item. I suppose we could just say "Jump to item form"? Sorry for being so picky on this! I've just seen enough confusion about whether the page was in "add item" state or "edit item" state, and I don't want the link to add to the confusion. Just last night I was hoping someone would suggest "Jump to item form" so I could then top them with "Jump to form". (In reply to Phil Ringnalda from comment #10) > Just last night I was hoping someone would suggest "Jump to item form" so I > could then top them with "Jump to form". Works for me! Created attachment 180052 [details] [review] Bug 39400: "Jump to add item form" doesn't work while editing an existing item The link at the top of the item editor page to "Jump to add item form" tries to scrollIntoView the element with id="additema", but that element only exists while you are adding a new item. While you are editing an existing item, it is replaced by an element with id="edititem". Whichever element you have at the moment is always just below the form with id="f", so we can just scroll that into view instead. Test plan: 1. Without the patch, go to the details page for any bib record with at least one item, and click the Edit button on the row for an item in the holdings table. 2. You should be scrolled down to the form for editing that item 3. Scroll up to the top of the page, click the Jump to add item form link 4. You will not be scrolled back down to the form 5. Apply patch, shift+reload page 6. Now the link should scroll you back down to the form 7. Return to the biblio details page, click Edit - Manage items and verify that the Jump to add item form link still works when you are not editing an existing item 8. Click the Add multiple copies of this item button and add 30 items 9. Make sure that the link still scrolls the form into view both while you are editing an existing item, and while you are adding a new item Sponsored-by: Chetco Community Public Library Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Created attachment 180053 [details] [review] Bug 39400: (QA follow-up) Adjust link text Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> |