During work on bug 18501 we introduced a way to pass back status information from the trigger action in the Koha::Item object. We have since formalised such a procedure with the introduction of Koha::Object::Messages in bug 26555. We should migrate the custom implementation found in Koha::Item to use the formalised version from bug 26555. This would also include the enhancements to he message passing that were added in bug 23091.
Created attachment 118548 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages
This had completely slipped off my radar until I started digging into similar message passing for Koha::Account::Line->apply improvements. So.. I've quickly updated the code here to utilise the Koha::Object::Message handling code. CC's Nick and Kyle in case they weren't aware of these improvements to the Koha::Object system.. I can see them being helpful more widely.
Created attachment 122004 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages
Rebased
This looks nice, and I'm glad the messages do the job! Can you give us a test plan?
Basically.. follow the test plan for bug 23091 and check that it all continues to work ;)
Created attachment 128070 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages
Created attachment 128084 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 128085 [details] [review] Bug 26704: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130027 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 130028 [details] [review] Bug 26704: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Happy to add another sign-off: Patches apply, patches pass, QA script passes and code looks sensible. The commit messages are a bit bare. ;)
+ my @object_messages = @{ $updated_item->messages }; I think this needs to be adapted since Bug 29785 is pushed. Check if there are other impacts
Created attachment 130484 [details] [review] Bug 26704: Update Koha::Item to use Koha::Object::Messages Use the newly introduced Koha::Object::Messages system to pass additional information provided by object methods internally in the objects themselves. This patch updates the existing bespoke passing scheme to something we've formally agreed to adopt going forward. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 130485 [details] [review] Bug 26704: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 130486 [details] [review] Bug 26704: (follow-up) Rebase for bug 29785 Update newly introduced calls from '->messages' to '->object_messages' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Rebased and follow-up added to take account of bug 29785. Ready for push :)
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
t/db_dependent/Koha/Items.t is failing because of this.
Created attachment 130657 [details] [review] Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t Note this patch also fixes wrong text in test line 1295
Please validate this fix.
Created attachment 130658 [details] [review] Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t Note this patch also fixes wrong text in test line 1295 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
> Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t Pushed to master