Bug 36612 - The public tickets endpoint needs public fields list
Summary: The public tickets endpoint needs public fields list
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Martin Renvoize
QA Contact:
URL:
Keywords: Academy
Depends on: 28948 31028
Blocks: 34255
  Show dependency treegraph
 
Reported: 2024-04-16 17:21 UTC by Martin Renvoize
Modified: 2024-04-29 11:13 UTC (History)
4 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:


Attachments
Bug 36612: Unit test for public ticket add (1.54 KB, patch)
2024-04-16 17:50 UTC, Martin Renvoize
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
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

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 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 2024-04-16 17:50:09 UTC
Created attachment 164960 [details] [review]
Bug 36612: Unit test for public ticket add
Comment 2 Martin Renvoize 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>