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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 834fc10650)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d6cf0250a9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2024-04-16 18:22:41 +01:00 committed by Lucas Gass
parent e2c05647ae
commit 8b056ba683
1 changed files with 14 additions and 0 deletions

View File

@ -168,6 +168,20 @@ sub store {
=cut
=head3 public_read_list
This method returns the list of publicly readable database fields for both API and UI output purposes
=cut
sub public_read_list {
return [
'ticket_id', 'title', 'body',
'reporter_id', 'reported_date', 'resolved_date',
'biblio_id'
];
}
=head3 to_api_mapping
This method returns the mapping for representing a Koha::Ticket object