[Koha-devel] On Koha::Object->store

Tomas Cohen Arazi tomascohen at gmail.com
Tue Sep 15 21:58:56 CEST 2020


Hi, I've been fixing a bug in Koha::Item->store, and I remembered I wasn't
sure why we keep the current behaviour instead of making ->store return the
->get_from_storage result like:

    return $self->SUPER::store->get_from_storage;

I know this is 'how DBIC works' but I don't think there's much gain by
avoiding it, and anyone calling ->store and doing something else
afterwards, needs to remember ->discard_changes (or better
->get_from_storage) needs to be called in order to have the auto
generated/updated fields the DB handles (autoincrement fields, timestamps,
etc).

So, is there a reason to keep this as-is?

-- 
Tomás Cohen Arazi
Theke Solutions (http://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20200915/28efd6e6/attachment.htm>


More information about the Koha-devel mailing list