Commit Graph

7 Commits

Author SHA1 Message Date
Martin Renvoize 60d84f91e6
Bug 41520: Filter out record_table from AdditionalFieldValue API responses
Bug 35451 added a record_table field to the additional_field_values
database table for performance optimization (better joins). However,
this field was not added to the OpenAPI schema, and with
additionalProperties: false, the API validator rejects responses
containing it.

Rather than adding this internal implementation detail to the public
API schema, this patch adds a custom to_api method to
Koha::AdditionalFieldValue that filters out the record_table field.

This approach:
1. Keeps the database optimization from Bug 35451
2. Prevents internal implementation details from cluttering the API
3. Maintains context that API consumers already have from parent objects
4. Fixes OpenAPI validation errors for ERM agreements, licenses, and
   packages using extended_attributes

Test plan:
1. Create an ERM agreement with additional fields/extended attributes
2. Access the agreement via the API with extended_attributes embedded
3. Verify the response includes extended_attributes but not record_table
4. Confirm no OpenAPI validation warnings in plack-api-error.log
5. prove t/db_dependent/api/v1/erm_agreements.t
6. Verify all tests pass

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:38 -07:00
Tomas Cohen Arazi 1873d97c07
Bug 40163: Fix several http addresses in the code docs
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:29 -06:00
Koha Development Team d659526b5a
Bug 38664: Tidy the whole codebase
This commit is generated using:
  % perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:24 +01:00
root cbacf68d7f Bug 22934: Add missing use statement
Also fixes a typo

To test:
1 - Add a subscription to a record
2 - Add an additional field in the admin section
3 - Edit the subscription and define the additional field
4 - Ensure you can view the record in the staff client and opac
5 - Without patch ,in the subscription detail page,click the link of the record title. => software error.
6 - Apply the patch. => no error anymore.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Fixed another typo on L21

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-23 14:43:16 +00:00
Nick Clemens 8035151e41 Bug 15774: (follow-up) Address QA issues
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:05 +00:00
Julian Maurice 284b543ea4 Bug 15774: Add POD and license notices
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:05 +00:00
Julian Maurice 904a488460 Bug 15774: Use Koha::Object(s) for additional fields
A lot of code can be removed just by using Koha::Object

It also makes fetching and updating additional field values easier.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:05 +00:00