Some methods are still using $self->SUPER::store instead of the overloaded method, so when you create a new request, it doesn't get things like created_on set.
Created attachment 125779 [details] [review] Bug 29182: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 125780 [details] [review] Bug 29182: Make sure methods call the overloaded ->store This patch addresses the issue of `request()` and `set_pending()` calling $self->SUPER::store instead of the overloaded one. This prevents created_on being set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/ArticleRequest.t => FAIL: created_on is not set on two methods 3. Apply this patch 4. Repeat 2 => SUCCESS: created_on is now set! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 125783 [details] [review] Bug 29182: (follow-up) Simplify Koha::ArticleRequest->store Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 125784 [details] [review] Bug 29182: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 125785 [details] [review] Bug 29182: Make sure methods call the overloaded ->store This patch addresses the issue of `request()` and `set_pending()` calling $self->SUPER::store instead of the overloaded one. This prevents created_on being set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/ArticleRequest.t => FAIL: created_on is not set on two methods 3. Apply this patch 4. Repeat 2 => SUCCESS: created_on is now set! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 125786 [details] [review] Bug 29182: (follow-up) Simplify Koha::ArticleRequest->store Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
4/54 Can't call method "letter_code" on an undefined value at /kohadevbox/koha/t/db_dependent/ArticleRequests.t line 82. # Looks like your test exited with 11 just after 4.
Created attachment 125869 [details] [review] Bug 29182: (follow-up) Fix ArticleRequests.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 125871 [details] [review] Bug 29182: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 125872 [details] [review] Bug 29182: Make sure methods call the overloaded ->store This patch addresses the issue of `request()` and `set_pending()` calling $self->SUPER::store instead of the overloaded one. This prevents created_on being set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/ArticleRequest.t => FAIL: created_on is not set on two methods 3. Apply this patch 4. Repeat 2 => SUCCESS: created_on is now set! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 125873 [details] [review] Bug 29182: (follow-up) Simplify Koha::ArticleRequest->store Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 125874 [details] [review] Bug 29182: (follow-up) Fix ArticleRequests.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All works well, QA scripts happy and Tests passing.. Passing QA. It's great to see this area getting some attention and modernisation.
Pushed to master for 21.11, thanks to everybody involved!