Summary: | Add item form includes itemnumber while adding a new item | ||
---|---|---|---|
Product: | Koha | Reporter: | Phil Ringnalda <phil> |
Component: | Cataloging | Assignee: | Phil Ringnalda <phil> |
Status: | Pushed to main --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31323 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
25.05.00
|
Circulation function: | |
Bug Depends on: | 36192 | ||
Bug Blocks: | |||
Attachments: |
Bug 39570: Add item form includes itemnumber while adding a new item
Bug 39570: Add item form includes itemnumber while adding a new item Bug 39570: Add item form includes itemnumber while adding a new item |
Description
Phil Ringnalda
2025-04-04 18:46:49 UTC
Created attachment 180682 [details] [review] Bug 39570: Add item form includes itemnumber while adding a new item Because the template uses the wrong op, add_item rather than cud-additem, to decide whether to include a hidden input with the itemnumber, if you edit an item and then add another item you wind up submitting a form that includes the previous itemnumber when you add a new one. Nothing happens, because the code for adding an item doesn't look at $input->param('itemnumber'), but since it doesn't mean anything we shouldn't be submitting it. Test plan: 1. Without the patch, find any biblio with at least one item attached, and in the items table click Edit item on one of them 2. Without needing to making any changes, click Save changes 3. In the page that loads, scroll down to the bottom of the Add item form, right-click the Add item button, and choose Inspect 4. A few lines up, above a '<fieldset class="action">,' there will be an '<input type="hidden" name="itemnumber" value="633">' with the itemnumber of the item you previously edited 5. Apply patch 6. Scroll up, click Actions - Edit on any item, then Save changes 7. Again, right-click the Add item button, Inspect, note that there isn't a itemnumber input with the number of the item you previously edited Sponsored-by: Chetco Community Public Library Created attachment 180713 [details] [review] Bug 39570: Add item form includes itemnumber while adding a new item Because the template uses the wrong op, add_item rather than cud-additem, to decide whether to include a hidden input with the itemnumber, if you edit an item and then add another item you wind up submitting a form that includes the previous itemnumber when you add a new one. Nothing happens, because the code for adding an item doesn't look at $input->param('itemnumber'), but since it doesn't mean anything we shouldn't be submitting it. Test plan: 1. Without the patch, find any biblio with at least one item attached, and in the items table click Edit item on one of them 2. Without needing to making any changes, click Save changes 3. In the page that loads, scroll down to the bottom of the Add item form, right-click the Add item button, and choose Inspect 4. A few lines up, above a '<fieldset class="action">,' there will be an '<input type="hidden" name="itemnumber" value="633">' with the itemnumber of the item you previously edited 5. Apply patch 6. Scroll up, click Actions - Edit on any item, then Save changes 7. Again, right-click the Add item button, Inspect, note that there isn't a itemnumber input with the number of the item you previously edited Sponsored-by: Chetco Community Public Library Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Created attachment 180814 [details] [review] Bug 39570: Add item form includes itemnumber while adding a new item Because the template uses the wrong op, add_item rather than cud-additem, to decide whether to include a hidden input with the itemnumber, if you edit an item and then add another item you wind up submitting a form that includes the previous itemnumber when you add a new one. Nothing happens, because the code for adding an item doesn't look at $input->param('itemnumber'), but since it doesn't mean anything we shouldn't be submitting it. Test plan: 1. Without the patch, find any biblio with at least one item attached, and in the items table click Edit item on one of them 2. Without needing to making any changes, click Save changes 3. In the page that loads, scroll down to the bottom of the Add item form, right-click the Add item button, and choose Inspect 4. A few lines up, above a '<fieldset class="action">,' there will be an '<input type="hidden" name="itemnumber" value="633">' with the itemnumber of the item you previously edited 5. Apply patch 6. Scroll up, click Actions - Edit on any item, then Save changes 7. Again, right-click the Add item button, Inspect, note that there isn't a itemnumber input with the number of the item you previously edited Sponsored-by: Chetco Community Public Library Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed for 25.05! Well done everyone, thank you! |