Commit Graph

2 Commits

Author SHA1 Message Date
Kyle M Hall 356903a96a
Bug 32370: (QA follow-up) Add https to license url, use Test::NoWarnings
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-22 10:02:26 -07:00
Tomas Cohen Arazi 6d4965f2d3
Bug 32370: Provide a generic set of tools for JSON fields
This patch introduces a new class for extending Koha::Object-based
classes so they have reusable ways to deal with JSON encoded fields.

As documented in the POD, classes can now

```perl
use base qw(Koha::Object Koha::Object::JSONFields);
```

and will have the following methods available:

* decode_json_field
* set_encoded_json_field

For convenience, the Koha::Auth::Identity::Provider class is tweaked to
make use of this, and also to prove the behavior is correct (expected
results, exceptions, encoding, etc).

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Object/JSONField.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-22 10:02:25 -07:00