We need a new objects.find mojolicious helper, just as objects.search, that enables embedding child objects and authorisation values expansion
Created attachment 111418 [details] [review] Bug 26636: Add tests Add tests in t/db_dependent/Koha/REST/Plugin/Objects.t
Created attachment 111419 [details] [review] Bug 26636: Add objects.find helper This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded children and expanded authorised values. This patch will be implemented in bug 8179, so please test there
Please rebase for testing bug 8179
Created attachment 116222 [details] [review] Bug 26636: Add tests This patch adds tests for the new objects.find helper. Sponsored-by: Virginia Tech Libraries
Created attachment 116223 [details] [review] Bug 26636: Add objects.find helper This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded. Sponsored-by: Virginia Tech Libraries
Created attachment 116224 [details] [review] Bug 26636: (QA follow-up) Add POD Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116225 [details] [review] Bug 26636: Regression tests for undef case This patch adds tests for the case in which there's no object identified by the supplied $id. It should return undef. Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116226 [details] [review] Bug 26636: (QA follow-up) Handle no results correctly Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
With Agustin's permission, I decided to remove the authorised values bit from this bug, and move it to 26635. I added some QA follow-ups in the process. Dependencies changed as well.
Created attachment 116227 [details] [review] Bug 26636: Add tests This patch adds tests for the new objects.find helper. Sponsored-by: Virginia Tech Libraries Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116228 [details] [review] Bug 26636: Add objects.find helper This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded. Sponsored-by: Virginia Tech Libraries Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116229 [details] [review] Bug 26636: (QA follow-up) Add POD Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116230 [details] [review] Bug 26636: Regression tests for undef case This patch adds tests for the case in which there's no object identified by the supplied $id. It should return undef. Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116231 [details] [review] Bug 26636: (QA follow-up) Handle no results correctly Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116594 [details] [review] Bug 26636: Add tests This patch adds tests for the new objects.find helper. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116595 [details] [review] Bug 26636: Add objects.find helper This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116596 [details] [review] Bug 26636: (QA follow-up) Add POD Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116597 [details] [review] Bug 26636: Regression tests for undef case This patch adds tests for the case in which there's no object identified by the supplied $id. It should return undef. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 116598 [details] [review] Bug 26636: (QA follow-up) Handle no results correctly Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 117669 [details] [review] Bug 26636: Add tests This patch adds tests for the new objects.find helper. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 117670 [details] [review] Bug 26636: Add objects.find helper This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 117671 [details] [review] Bug 26636: (QA follow-up) Add POD Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 117672 [details] [review] Bug 26636: Regression tests for undef case This patch adds tests for the case in which there's no object identified by the supplied $id. It should return undef. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 117673 [details] [review] Bug 26636: (QA follow-up) Handle no results correctly Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
A clear and concise patchset that include regressions tests, works as expected and passes QA script. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Enhancement not pushed to 20.11.x
Created attachment 127528 [details] [review] Bug 26636: Add tests [20.11.x] This patch adds tests for the new objects.find helper. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127529 [details] [review] Bug 26636: Add objects.find helper [20.11.x] This patch adds the objects.find helper. Much like objects.search, it returns the to_api method with embedded. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127530 [details] [review] Bug 26636: (QA follow-up) Add POD [20.11.x] Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127531 [details] [review] Bug 26636: Regression tests for undef case [20.11.x] This patch adds tests for the case in which there's no object identified by the supplied $id. It should return undef. Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127532 [details] [review] Bug 26636: (QA follow-up) Handle no results correctly [20.11.x] Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>