Bug 33021 - Show an alert when adding an item on hold to an item bundle
Summary: Show an alert when adding an item on hold to an item bundle
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 32121
Blocks: 33769
  Show dependency treegraph
 
Reported: 2023-02-21 10:22 UTC by Julian Maurice
Modified: 2023-12-28 20:42 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/694
Text to go in the release notes:
When adding an item that is currently on hold to an item bundle, a warning will display, but you can still choose to add the item to the bundle.
Version(s) released in:
23.05.00


Attachments
Bug 33021: Show an alert when adding a reserved item to an item bundle (5.55 KB, patch)
2023-02-21 10:22 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 33021: Show an alert when adding a reserved item to an item bundle (5.55 KB, patch)
2023-02-22 14:40 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 33021: Show an alert when adding a reserved item to an item bundle (5.67 KB, patch)
2023-03-24 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 33021: (QA follow-up) Add unit test (2.35 KB, patch)
2023-03-24 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2023-02-21 10:22:08 UTC

    
Comment 1 Julian Maurice 2023-02-21 10:22:54 UTC
Created attachment 147019 [details] [review]
Bug 33021: Show an alert when adding a reserved item to an item bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and place a hold for this item.
3. Try to add the reserved item to the bundle
   You should see a message saying that the item is reserved. Next to
   this message should be a button "Ignore holds and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   added to the bundle
Comment 2 Lucas Gass 2023-02-21 21:30:09 UTC
This works as described but I do notice a 409 ( conflict ) error in the console.


-http://localhost:8081/api/v1/items/974/bundled_items


Is this a problem that needs addressed?
Comment 3 Julian Maurice 2023-02-22 08:09:16 UTC
(In reply to Lucas Gass from comment #2)
> This works as described but I do notice a 409 ( conflict ) error in the
> console.
> 
> 
> -http://localhost:8081/api/v1/items/974/bundled_items
> 
> 
> Is this a problem that needs addressed?

It's normal. It's the status code used to indicate that the item was not added to the bundle. After you click on the button you should have the same API call but with a 2XX status code
Comment 4 Lucas Gass 2023-02-22 14:11:24 UTC
OK, sounds good. Just one more thing to note, a complaint from the QA tool:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
   FAIL	  forbidden patterns
		forbidden pattern: simple-quote string (line 1833)
Comment 5 Julian Maurice 2023-02-22 14:26:41 UTC
(In reply to Lucas Gass from comment #4)
> 		forbidden pattern: simple-quote string (line 1833)

That is probably a false positive. I think this rule refer to using simple quotes inside _(), but this this patch doesn't use this function.
Can someone from QA confirm ?
Comment 6 Lucas Gass 2023-02-22 14:38:55 UTC
(In reply to Julian Maurice from comment #5)
> (In reply to Lucas Gass from comment #4)
> > 		forbidden pattern: simple-quote string (line 1833)
> 
> That is probably a false positive. I think this rule refer to using simple
> quotes inside _(), but this this patch doesn't use this function.
> Can someone from QA confirm ?

It looks right to me and the syntax/format is exactly the same as some of the other lines directly above. I will sign-off and move this along for QA to have a look.
Comment 7 Lucas Gass 2023-02-22 14:40:11 UTC
Created attachment 147160 [details] [review]
Bug 33021: Show an alert when adding a reserved item to an item bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and place a hold for this item.
3. Try to add the reserved item to the bundle
   You should see a message saying that the item is reserved. Next to
   this message should be a button "Ignore holds and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   added to the bundle
Comment 8 Kyle M Hall 2023-03-24 14:44:13 UTC
Created attachment 148665 [details] [review]
Bug 33021: Show an alert when adding a reserved item to an item bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and place a hold for this item.
3. Try to add the reserved item to the bundle
   You should see a message saying that the item is reserved. Next to
   this message should be a button "Ignore holds and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   added to the bundle

Signed-off-by: Lucas Gass <lucas@bywatersolutiosn.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2023-03-24 14:44:23 UTC
Created attachment 148666 [details] [review]
Bug 33021: (QA follow-up) Add unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Tomás Cohen Arazi 2023-03-27 10:47:43 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Matt Blenkinsop 2023-04-11 10:50:37 UTC
Enhancement - not backporting to 22.11.x

Nice work everyone!