Bug 30074 - Missing extended_attributes relationship in DBIC schema
Summary: Missing extended_attributes relationship in DBIC schema
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 30055 30093
  Show dependency treegraph
 
Reported: 2022-02-10 14:26 UTC by Jonathan Druart
Modified: 2022-12-12 21:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00


Attachments
Bug 30074: Add missing extended_attributes rs in DBIC schema (1.59 KB, patch)
2022-02-10 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30074: Regression tests (1.24 KB, patch)
2022-02-16 14:53 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30074: Add missing extended_attributes rs in DBIC schema (1.84 KB, patch)
2022-02-16 14:53 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30074: Regression tests (1.30 KB, patch)
2022-02-17 12:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30074: Add missing extended_attributes rs in DBIC schema (1.90 KB, patch)
2022-02-17 12:15 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-02-10 14:26:50 UTC
REST API route /patrons has extended_attributes available (x-koha-embed) but it's actually not working.

GET /api/v1/patrons: unhandled exception (Koha::Exceptions::BadParameter)<<Cannot find Koha::Object class for extended_attributes>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbo
x/koha/Koha/REST/Plugin/Exceptions.pm (73)

It's missing the relationship named "extended_attributes".
Comment 1 Jonathan Druart 2022-02-10 14:29:29 UTC
Created attachment 130448 [details] [review]
Bug 30074: Add missing extended_attributes rs in DBIC schema

REST API route /patrons has extended_attributes available (x-koha-embed) but it's actually not working.

GET /api/v1/patrons: unhandled exception (Koha::Exceptions::BadParameter)<<Cannot find Koha::Object class for extended_attributes>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbo
x/koha/Koha/REST/Plugin/Exceptions.pm (73)

It's missing the relationship named "extended_attributes".

Test plan:
Create a new patron attribute CODE and a value for a patron

Hit /api/v1/patrons?q={"extended_attributes.type":"CODE"}
Comment 2 Jonathan Druart 2022-02-10 14:29:53 UTC
A test would be nice.
Comment 3 Tomás Cohen Arazi 2022-02-16 14:53:15 UTC
Created attachment 130667 [details] [review]
Bug 30074: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2022-02-16 14:53:19 UTC
Created attachment 130668 [details] [review]
Bug 30074: Add missing extended_attributes rs in DBIC schema

REST API route /patrons has extended_attributes available (x-koha-embed) but it's actually not working.

GET /api/v1/patrons: unhandled exception (Koha::Exceptions::BadParameter)<<Cannot find Koha::Object class for extended_attributes>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbo
x/koha/Koha/REST/Plugin/Exceptions.pm (73)

It's missing the relationship named "extended_attributes".

Test plan:
Create a new patron attribute CODE and a value for a patron

Hit /api/v1/patrons?q={"extended_attributes.type":"CODE"}

Also:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail, boooo
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Martin Renvoize 2022-02-17 12:15:21 UTC
Created attachment 130724 [details] [review]
Bug 30074: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-02-17 12:15:25 UTC
Created attachment 130725 [details] [review]
Bug 30074: Add missing extended_attributes rs in DBIC schema

REST API route /patrons has extended_attributes available (x-koha-embed) but it's actually not working.

GET /api/v1/patrons: unhandled exception (Koha::Exceptions::BadParameter)<<Cannot find Koha::Object class for extended_attributes>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbo
x/koha/Koha/REST/Plugin/Exceptions.pm (73)

It's missing the relationship named "extended_attributes".

Test plan:
Create a new patron attribute CODE and a value for a patron

Hit /api/v1/patrons?q={"extended_attributes.type":"CODE"}

Also:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail, boooo
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-02-17 12:15:40 UTC
All good, PQA
Comment 8 Fridolin Somers 2022-02-22 01:14:50 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄