Bug 26819

Summary: Error when adding items to course reserves - can't view items in the staff interface
Product: Koha Reporter: David Nind <david>
Component: Course reservesAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: blocker    
Priority: P5 - low CC: andrewfh, david, fridolin.somers, jonathan.druart, kyle, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes an error introduced during the 20.11 development cycle with course reserves. After adding an item you could not list the items for a course in the staff interface (an error page was generated), and you could not add additional items.
Version(s) released in:
20.11.00
Bug Depends on: 26323    
Bug Blocks:    
Attachments: Error trace - listing items for a course reserve
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
Bug 26819: (QA follow-up) authorized_value should be authorised_value
Bug 26819: (QA follow-up) Fix branchtransfers.tt
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
Bug 26819: (QA follow-up) authorized_value should be authorised_value
Bug 26819: (QA follow-up) Fix branchtransfers.tt

Description David Nind 2020-10-25 21:10:25 UTC
Created attachment 112487 [details]
Error trace - listing items for a course reserve

After adding an item to a course:
- you cannot view the items for the course in the staff interface, and
- there is an error trace message.

You can view the items as expected in the OPAC.

To recreate:

1. In the staff interface go to course reserves.
2. Add a new course.
3. Add a reserve (Add reserves > add a valid barcode > submit).
4. Go to the list of courses and select the course you added the item to.
5. An error trace log is generated - see attachment.

Tested on master using koha-testing-docker.

Functionality works as expected in 20.05.x. 

Identified when testing bug 19532
Comment 1 Katrin Fischer 2020-11-01 00:53:51 UTC
Confirmed on master with kohadevbox. My item was 39999000000276 from sample data.
Comment 2 Kyle M Hall 2020-11-02 15:36:40 UTC
Created attachment 112848 [details] [review]
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt

Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!
Comment 3 David Nind 2020-11-02 19:01:13 UTC
Created attachment 112861 [details] [review]
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt

Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2020-11-02 21:34:19 UTC
Created attachment 112878 [details] [review]
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt

Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-11-03 08:08:08 UTC
Caused by 
  commit 9bbf90969304943210e24dcd69422c9fe7d28303
  Bug 26323: (follow-up) Add new cases introduced
Comment 6 Jonathan Druart 2020-11-03 08:10:20 UTC
It may fixes the crash, but not the behaviour. The parameter is authorised_value, not authorized_value.
Comment 7 Jonathan Druart 2020-11-03 08:11:43 UTC
There is also another occurrence in circ/branchtransfers.tt
Comment 8 Kyle M Hall 2020-11-23 14:44:20 UTC
Created attachment 113926 [details] [review]
Bug 26819: (QA follow-up) authorized_value should be authorised_value
Comment 9 Kyle M Hall 2020-11-23 14:44:30 UTC
Created attachment 113927 [details] [review]
Bug 26819: (QA follow-up) Fix branchtransfers.tt
Comment 10 Jonathan Druart 2020-11-25 09:30:23 UTC
*** Bug 27038 has been marked as a duplicate of this bug. ***
Comment 11 Tomás Cohen Arazi 2020-11-25 13:02:47 UTC
Created attachment 113978 [details] [review]
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt

Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 12 Tomás Cohen Arazi 2020-11-25 13:02:54 UTC
Created attachment 113979 [details] [review]
Bug 26819: (QA follow-up) authorized_value should be authorised_value

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 13 Tomás Cohen Arazi 2020-11-25 13:03:02 UTC
Created attachment 113980 [details] [review]
Bug 26819: (QA follow-up) Fix branchtransfers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 14 Tomás Cohen Arazi 2020-11-25 13:03:41 UTC
Works as expected, passes the QA script.

Sanity check is ok as well:

$ git grep AuthorisedValues.GetDescriptionByKohaField | grep -v authorised_value
=> empty
Comment 15 Jonathan Druart 2020-11-25 15:19:59 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 16 Andrew Fuerste-Henry 2020-12-14 15:09:51 UTC
Missing dependencies, not backported for 20.05.x