]> git.koha-community.org Git - koha.git/commit
Bug 30074: Add missing extended_attributes rs in DBIC schema
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Feb 2022 14:28:11 +0000 (15:28 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 22 Feb 2022 01:15:47 +0000 (15:15 -1000)
commit78a9de0cd6a60e746e53ed9120f669d6ed3625cc
treebc4bfcc3395290c48ddbf05b42e7a8454b4d9e40
parent2ae8d149d3341e7d880051ffed3903fab6262a69
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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Schema/Result/Borrower.pm