Bug 26819 - Error when adding items to course reserves - can't view items in the staff interface
Summary: Error when adding items to course reserves - can't view items in the staff in...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: master
Hardware: All All
: P5 - low blocker (vote)
Assignee: Kyle M Hall
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
: 27038 (view as bug list)
Depends on: 26323
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-25 21:10 UTC by David Nind
Modified: 2021-01-05 08:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
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


Attachments
Error trace - listing items for a course reserve (15.05 KB, text/plain)
2020-10-25 21:10 UTC, David Nind
Details
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt (3.22 KB, patch)
2020-11-02 15:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt (3.26 KB, patch)
2020-11-02 19:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt (3.32 KB, patch)
2020-11-02 21:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26819: (QA follow-up) authorized_value should be authorised_value (3.26 KB, patch)
2020-11-23 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 26819: (QA follow-up) Fix branchtransfers.tt (1.69 KB, patch)
2020-11-23 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt (3.36 KB, patch)
2020-11-25 13:02 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26819: (QA follow-up) authorized_value should be authorised_value (3.30 KB, patch)
2020-11-25 13:02 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26819: (QA follow-up) Fix branchtransfers.tt (1.73 KB, patch)
2020-11-25 13:03 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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