Bug 36612 - The public tickets endpoint needs public fields list
Summary: The public tickets endpoint needs public fields list
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Martin Renvoize (ashimema)
QA Contact:
URL:
Keywords:
Depends on: 28948 31028
Blocks: 34255
  Show dependency treegraph
 
Reported: 2024-04-16 17:21 UTC by Martin Renvoize (ashimema)
Modified: 2024-05-23 14:26 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12
Circulation function:


Attachments
Bug 36612: Unit test for public ticket add (1.54 KB, patch)
2024-04-16 17:50 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36612: Add public_read_list to Koha::Ticket (1.48 KB, patch)
2024-04-16 17:50 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36612: Add public_read_list to Koha::Ticket (1.53 KB, patch)
2024-04-22 11:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 36612: Unit test for public ticket add (1.58 KB, patch)
2024-04-22 11:40 UTC, David Nind
Details | Diff | Splinter Review
Bug 36612: Add public_read_list to Koha::Ticket (1.53 KB, patch)
2024-04-22 11:40 UTC, David Nind
Details | Diff | Splinter Review
Bug 36612: (QA follow-up) Add 'source' to public_read_list (763 bytes, patch)
2024-05-07 12:08 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-04-16 17:21:55 UTC
We missed adding the public_read_list routine to Koha::Ticket somewhere along the line.

We need said list to prevent a 500 response from the POST /api/v1/public/tickets endpoint which is used by the OPAC for adding catalog concerns.
Comment 1 Martin Renvoize (ashimema) 2024-04-16 17:50:09 UTC
Created attachment 164960 [details] [review]
Bug 36612: Unit test for public ticket add
Comment 2 Martin Renvoize (ashimema) 2024-04-16 17:50:12 UTC
Created attachment 164961 [details] [review]
Bug 36612: Add public_read_list to Koha::Ticket

Without the public_read_list to define which fields should be accessible
from the public endpoints we will always return a 500 from the API on
otherwise successfull additions of tickets via the OPAC.

Test plan
1) Enable OPACCatalogConcerns
2) Login to the OPAC and "Report a concern"
3) Note the error message in the UI "There was an error when submitting
   your concern, please contact a librarian."
4) Confirm that the concern is actually created regardless
5) Apply the patch here and restart plack
6) Submit another 'Report a concern' and now note the success message
   "Your concern was successfully submitted."
Comment 3 David Nind 2024-04-22 11:35:29 UTC Comment hidden (obsolete)
Comment 4 David Nind 2024-04-22 11:40:47 UTC
Created attachment 165269 [details] [review]
Bug 36612: Unit test for public ticket add

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-04-22 11:40:49 UTC
Created attachment 165270 [details] [review]
Bug 36612: Add public_read_list to Koha::Ticket

Without the public_read_list to define which fields should be accessible
from the public endpoints we will always return a 500 from the API on
otherwise successfull additions of tickets via the OPAC.

Test plan
1) Enable OPACCatalogConcerns
2) Login to the OPAC and "Report a concern"
3) Note the error message in the UI "There was an error when submitting
   your concern, please contact a librarian."
4) Confirm that the concern is actually created regardless
5) Apply the patch here and restart plack
6) Submit another 'Report a concern' and now note the success message
   "Your concern was successfully submitted."

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Katrin Fischer 2024-05-03 09:00:03 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Martin Renvoize (ashimema) 2024-05-07 12:03:23 UTC
The combination of bug 35616 and this bug introduces failures in the new tests introduced here.

Working on the fix now.
Comment 8 Martin Renvoize (ashimema) 2024-05-07 12:08:38 UTC
Created attachment 166261 [details] [review]
Bug 36612: (QA follow-up) Add 'source' to public_read_list

This patch adds the required 'source' field to the public_read_list for
tickets.
Comment 9 Katrin Fischer 2024-05-07 13:56:15 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-22 12:56:56 UTC
Pushed to 23.11.x for 23.11.06
Comment 11 Lucas Gass (lukeg) 2024-05-23 14:26:00 UTC
Backported to 23.05.x for upcoming 23.05.12.