Bug 42875: Correct failure message when adding an item to a bundle

If bc_1 is checked out and I try to add bc_2 I get:
"Failure: Item 'bc_2' belongs to another bundle"

It should be:
"Failure: Bundle is currently checked out"

Test plan (using KTD):
1. Pick a record with items, for example: The definitive guide to Catalyst (146)
2. Edit the record and change 000 (the leader):
   - Click the tag editor
   - Change "7- Bibliographic level" to "C- Collection"
3. In the holdings table there is now a "Manage bundle (0|0)" option
   in the far right column for each item.
4. Check an item out for the record out, for example
   I checked out 39999000006117 to Mary Burton.
5. In the holdings table for the record, click on "Manage bundle" for the item
   you checked out (39999000006117).
6. In the expanded text area below the item row, click "+ Add to bundle".
7. In pop-up window, enter 39999000006131 "Item barcode" field (this is one
   of the other items for the record that is not checked out).
8. Click Submit.
9. You get an error:
     Failure: Item '39999000006131' belongs to another bundle
10. Apply the patch.
11. Restart everything: restart all
12. Hard refresh the page for the record.
13. Repeat steps 5 to 8.
14. You now get the correct error:
      "Failure: Bundle is currently checked out"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2026-07-07 10:14:35 +02:00 committed by Pedro Amorim
parent 0c952e9e09
commit d80ca5f4e8
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 2 additions and 2 deletions

View File

@ -2039,7 +2039,7 @@
if (response.status === 409) {
if (responseJSON.error_code === "already_bundled") {
$("#addResult").replaceWith('<div id="addResult" class="alert alert-warning">' + _("Warning: Item '%s' already attached").format(barcode) + "</div>");
} else if (responseJSON.error_code === "bundle_checkout_out") {
} else if (responseJSON.error_code === "bundle_checked_out") {
$("#addResult").replaceWith('<div id="addResult" class="alert alert-danger">' + _("Failure: Bundle is currently checked out") + "</div>");
} else if (responseJSON.error_code === "checked_out") {
const button = $('<button type="button">')
@ -2151,7 +2151,7 @@
var barcode = $("#rm_external_id").val();
if (data.status === 409) {
var response = data.responseJSON;
if (response.error_code === "bundle_checkout_out") {
if (response.error_code === "bundle_checked_out") {
$("#removeResult").replaceWith('<div id="removeResult" class="alert alert-danger">' + _("Failure: Bundle is currently checked out") + "</div>");
} else if (response.key === "PRIMARY") {
$("#removeResult").replaceWith('<div id="removeResult" class="alert alert-warning">' + _("Warning: Item '%s' already attached").format(barcode) + "</div>");