From 27aed4c7e59431bf2d896cb830c28210e930c01a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 22 Apr 2024 14:33:33 +0200 Subject: [PATCH] Bug 36649: Correctly embed biblio when retrieving items when adding to a train MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I didn't find when this regression has been introduced but the third parameter here is the headers, not parameters, we should not repeat "headers". Test plan: 1. Add a new processing that contains columns from the database, for example biblio.title and biblio.author. 2. Create a new train. 3. Add items to the waiting list. 4. Click on "Add last x items to the train" button. 5. Choose the train you created on number 2. 6. Choose the processing you added on number 1. 7. Try to click the Submit button. => Without the patch nothing happens and there is a JS error in the console: Uncaught TypeError: item.biblio is undefined => With this patch applied the item is correctly added to the train and the attribute is properly populated. Signed-off-by: Anneli Österman Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer (cherry picked from commit 63612311e32a546a6ea1067e0c65ac3199f2f292) Signed-off-by: Fridolin Somers --- .../components/Preservation/TrainsFormAddItems.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue index 7a35d71334..521790581a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue @@ -167,14 +167,12 @@ export default { async getItems(item_ids) { const client = APIClient.item let q = { "me.item_id": item_ids } - await client.items - .getAll(q, {}, { headers: { "x-koha-embed": "biblio" } }) - .then( - items => { - this.items = items - }, - error => {} - ) + await client.items.getAll(q, {}, { "x-koha-embed": "biblio" }).then( + items => { + this.items = items + }, + error => {} + ) }, columnApiMapping(item, db_column) { let table_col = db_column.split(".") -- 2.39.5