Summary: | Adding recently added items to processing from waiting list does not work if processing includes information from database columns | ||
---|---|---|---|
Product: | Koha | Reporter: | Anneli Österman <anneli.osterman> |
Component: | Preservation | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | RESOLVED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | emmi.takkinen, fridolin.somers, jonathan.druart, lucas, pedro.amorim |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
24.05.00,23.11.06
|
|
Circulation function: | |||
Bug Depends on: | 30708 | ||
Bug Blocks: | |||
Attachments: |
Bug 36649: Correctly embed biblio when retrieving items when adding to a train
Bug 36649: Correctly embed biblio when retrieving items when adding to a train Bug 36649: Correctly embed biblio when retrieving items when adding to a train |
Description
Anneli Österman
2024-04-19 10:20:55 UTC
This problem is caused by line 185 in TrainsFormAddItems.vue: item.biblio[api_attribute]. Apparently, if attribute uses column from biblio or biblioitems table, attribute should be fetched from biblio array which is part of item object. However there is no such an array. Created attachment 165275 [details] [review] Bug 36649: Correctly embed biblio when retrieving items when adding to a train 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. Created attachment 165372 [details] [review] Bug 36649: Correctly embed biblio when retrieving items when adding to a train 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 <anneli.osterman@koha-suomi.fi> Created attachment 165376 [details] [review] Bug 36649: Correctly embed biblio when retrieving items when adding to a train 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 <anneli.osterman@koha-suomi.fi> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Before, we added x-koha-embed headers at the http client level (see erm-api-client.js) not at the vue component level as you're doing here @Joubu. Not a blocker, but may be worth mentioning as it's a deviation of the pattern? (In reply to Pedro Amorim from comment #5) > Before, we added x-koha-embed headers at the http client level (see > erm-api-client.js) not at the vue component level as you're doing here > @Joubu. > > Not a blocker, but may be worth mentioning as it's a deviation of the > pattern? This is expected, we are supposed to embed when needed. Here we don't want to embed biblio's info from everywhere we are fetching items. It's how getAll is designed: get items() { return { getAll: (query, params, headers) => Pushed for 24.05! Well done everyone, thank you! Pushed to 23.11.x for 23.11.06 Not needed in 23.05.x |