A new request with request id 18867 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is :
Title : Koha-devel Digest, Vol 185, Issue 9
Category :
Description : Send Koha-devel mailing list submissions to
koha-devel@lists.koha-community.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
or, via email, send a message with subject or body 'help' to
koha-devel-request@lists.koha-community.org
You can reach the person managing the list at
koha-devel-owner@lists.koha-community.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Koha-devel digest..."
Today's Topics:
1. Re: Plugin hooks on datas and store() (Fridolin SOMERS)
2. koha-testing-docker / master broken? (dcook@prosentient.com.au)
----------------------------------------------------------------------
Message: 1
Date: Mon, 12 Apr 2021 12:55:22 +0200
From: Fridolin SOMERS <fridolin.somers@biblibre.com>
To: Tomas Cohen Arazi <tomascohen@gmail.com>
Cc: Jonathan Druart <jonathan.druart@bugs.koha-community.org>,
koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Plugin hooks on datas and store()
Message-ID: <1e475ecf-5642-a12d-fcee-209d88962311@biblibre.com>
Content-Type: text/plain; charset=utf-8; format=flowed
For example I try for example to edit items.note after item modification.
I need this but just trying to understand if its possible or not.
If its not possible we should document it :D
Best regards
Le 12/03/2021 à 18:00, Tomas Cohen Arazi a écrit :
> What are you actually trying to accomplish? Do you really need the
> post-store object?
>
> El vie., 12 mar. 2021 12:34, Fridolin SOMERS
> <fridolin.somers@biblibre.com <mailto:fridolin.somers@biblibre.com>>
> escribió:
>
> Oh indeed,
>
> So maybe :
> 1) call SUPER::store()
> 2) call hook with $self
> 3) call SUPER::store() incase $seft has changed
>
> What do you think ?
>
> 2) must call $seft->discard_changes right ?
>
> Le 12/03/2021 à 15:14, Jonathan Druart a écrit :
> > So to have a "post_creation" hook that would be actually called
> *before*
> > the item is effectively created, hum... :)
> >
> >
> > Le ven. 12 mars 2021 à 13:47, Fridolin SOMERS
> > <fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>> a
> > écrit :
> >
> > Mmmm interesting.
> >
> > Why not send the $self object to plugin
> > and call SUPER::store() after hook ?
> >
> > Best regards,
> >
> >
> > Le 10/03/2021 à 09:22, Jonathan Druart a écrit :
> > > From perlobj pod:
> > > "The |SUPER| pseudo-class is resolved from the package
> where the
> > call is
> > > made. It is /not/ resolved based on the object's class."
> > >
> > > You can still call $item->_result->update.
> > >
> > > I suggest you open a bug report to add a no_trigger flag to
> > > Koha::Object->store (like we did in Koha::Objects).
> > >
> > > Also spotted, at the end of store:
> > > 193 my $result = $self->SUPER::store;
> > >
> > > 202 $self->get_from_storage->_after_item_action_hooks({
> > action =>
> > > $action });
> > > 203
> > > 204 return $result;
> > >
> > > That's wrong!
> > >
> > > Le mar. 9 mars 2021 à 09:32, Fridolin SOMERS
> > > <fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>> a
> > > écrit :
> > >
> > > Yop
> > >
> > > I've tried with :
> > >
> > > sub after_item_action {
> > > my ( $self, $params ) = @_;
> > > warn "AFTER ITEM ACTION";
> > >
> > > my $item = $params->{item};
> > > $item->itemnotes("Edited at " . localtime);
> > > }
> > >
> > > Calling $item->SUPER::store() generates an error :
> > >
> > > Plugin error (Example Kitchen-Sink Plugin): Can't locate
> > object method
> > > "store" via package
> > "Koha::Plugin::Com::ByWaterSolutions::KitchenSink"
> > > at
> > >
> >
> /mnt/git/koha-plugin-kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm
> > >
> > > line 580.
> > >
> > > Surely only Koha::Item can call SUPER.
> > >
> > > Adding $self->SUPER::store() at the end of
> > Koha::Item->store() does
> > > also
> > > not work.
> > >
> > > Is it because of "get_from_storage" ?
> > >
> > > $self->get_from_storage->_after_item_action_hooks({
> action =>
> > > $action });
> > >
> > > The _after_item_action_hooks method is called not on
> object $self
> > > but on
> > > a copy ?
> > >
> > > Best regards,
> > >
> > > Le 08/03/2021 à 11:49, Jonathan Druart a écrit :
> > > > I wouldn't add other hooks, they are
> > "_after_item_action_hooks" for
> > > > creation and modification.
> > > > "After item creation" should allow you to modify
> the item,
> > unless we
> > > > need a "pre store" hook.
> > > > I had a look at the code and I didn't find any
> problems.
> > > > Fridolin, what did you try exactly, can you share
> the code?
> > > >
> > > > Le lun. 8 mars 2021 à 11:17, Tomas Cohen Arazi
> > > <tomascohen@gmail.com <mailto:tomascohen@gmail.com>
> <mailto:tomascohen@gmail.com <mailto:tomascohen@gmail.com>>
> > <mailto:tomascohen@gmail.com <mailto:tomascohen@gmail.com>
> <mailto:tomascohen@gmail.com <mailto:tomascohen@gmail.com>>>
> > > > <mailto:tomascohen@gmail.com
> <mailto:tomascohen@gmail.com> <mailto:tomascohen@gmail.com
> <mailto:tomascohen@gmail.com>>
> > <mailto:tomascohen@gmail.com <mailto:tomascohen@gmail.com>
> <mailto:tomascohen@gmail.com <mailto:tomascohen@gmail.com>>>>> a
> > > écrit :
> > > >
> > > > Maybe you need some other hook. Ones that
> allows you
> > to make
> > > changes
> > > > to the object right before it is stored instead of
> > this one, that
> > > > gets the 'just updated' object.
> > > > When I added 'after' hooks for biblios and items
> > actions, the
> > > idea
> > > > was that they should act as triggers for other
> > actions: in my
> > > case,
> > > > fill a zebraqueue-ish table my plugin uses.
> > > >
> > > > El lun, 8 mar 2021 a las 5:11, Fridolin SOMERS
> > > > (<fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>
> > > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>>>) escribió:
> > > >
> > > > Hi,
> > > >
> > > > While testing new hook :
> > > >
> > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>>
> > >
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>>>
> > > >
> > >
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>>
> > >
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>
> >
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066
> <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27066>>>>
> > > >
> > > > I faced a problem :
> > > > How can I modify the current patron object ?
> > > > Since we are in the store() method of that
> object and
> > > inside a
> > > > transation.
> > > > I tried to call $self->SUPER::store(); but does
> > not work.
> > > >
> > > > Should we implement this possiblity or document
> > hooks to
> > > say it is
> > > > impossible.
> > > >
> > > > Thanks a lot for your help :D
> > > >
> > > > Best regards,
> > > >
> > > > --
> > > > Fridolin SOMERS
> <fridolin.somers@biblibre.com <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>
> > > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>>>
> > > > Software and system maintainer 🦄
> > > > BibLibre, France
> > > > _______________________________________________
> > > > Koha-devel mailing list
> > > > Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>
> > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>>
> > > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>
> > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>>>
> > > >
> > >
> >
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>
> > >
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>>
> > > >
> > >
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>>>
> > > > website : https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>
> > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>>
> > > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>
> > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>>>
> > > > git : https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>
> > > <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>>
> > > > <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>
> > > <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>>>
> > > > bugs : https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>
> > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>>
> > > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>
> > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>>>
> > > >
> > > >
> > > >
> > > > --
> > > > Tomás Cohen Arazi
> > > > Theke Solutions (http://theke.io
> <http://theke.io> <http://theke.io <http://theke.io>>
> > <http://theke.io <http://theke.io> <http://theke.io
> <http://theke.io>>>
> > > <http://theke.io/ <http://theke.io/> <http://theke.io/
> <http://theke.io/>> <http://theke.io/ <http://theke.io/>
> > <http://theke.io/ <http://theke.io/>>>>)
> > > > ✆ +54 9351 3513384
> > > > GPG: B2F3C15F
> > > > _______________________________________________
> > > > Koha-devel mailing list
> > > > Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>
> > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>>
> > > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>
> > > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>
> > <mailto:Koha-devel@lists.koha-community.org
> <mailto:Koha-devel@lists.koha-community.org>>>>
> > > >
> > >
> >
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>
> > >
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>>
> > > >
> > >
> >
> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>>>>
> > > > website : https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>
> > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>>
> > > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>
> > > <https://www.koha-community.org/
> <https://www.koha-community.org/>
> > <https://www.koha-community.org/
> <https://www.koha-community.org/>>>>
> > > > git : https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>
> > > <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>> <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>
> > > <https://git.koha-community.org/
> <https://git.koha-community.org/>
> > <https://git.koha-community.org/
> <https://git.koha-community.org/>>>>
> > > > bugs : https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>
> > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>>
> > > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>
> > > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>
> > <https://bugs.koha-community.org/
> <https://bugs.koha-community.org/>>>>
> > > >
> > >
> > > --
> > > Fridolin SOMERS <fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> > > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>>
> > > Software and system maintainer 🦄
> > > BibLibre, France
> > >
> >
> > --
> > Fridolin SOMERS <fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>
> > <mailto:fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>>
> > Software and system maintainer 🦄
> > BibLibre, France
> >
>
> --
> Fridolin SOMERS <fridolin.somers@biblibre.com
> <mailto:fridolin.somers@biblibre.com>>
> Software and system maintainer 🦄
> BibLibre, France
>
--
Fridolin SOMERS <fridolin.somers@biblibre.com>
Software and system maintainer 🦄
BibLibre, France
------------------------------
Message: 2
Date: Tue, 13 Apr 2021 10:22:09 +1000
From: <dcook@prosentient.com.au>
To: <koha-devel@lists.koha-community.org>
Subject: [Koha-devel] koha-testing-docker / master broken?
Message-ID: <018001d72ffb$0adde510$2099af30$@prosentient.com.au>
Content-Type: text/plain; charset="utf-8"
I was upgrading my koha-testing-docker: "We are upgrading from Koha
20.12.00.003 to 20.12.00.029"
But it's failing with this error:
[Tue Apr 13 00:19:38 2021] updatedatabase.pl: {UNKNOWN}: DBI Exception:
DBD::mysql::db do failed: Duplicate entry 'TaxRates' for key 'PRIMARY' [for
Statement "UPDATE systempreferences set variable="TaxRates" WHERE
variable="gist""] at /usr/share/perl5/DBIx/Class/Schema.pm line 1118.
[Tue Apr 13 00:19:38 2021] updatedatabase.pl:
DBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x55deb3ffd678), "DBI
Exception: DBD::mysql::db do failed: Duplicate entry 'Tax"...) called at
/usr/share/perl5/DBIx/Class/Storage.pm line 113
[Tue Apr 13 00:19:38 2021] updatedatabase.pl:
DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(
0x55deb376ea38), "DBI Exception: DBD::mysql::db do failed: Duplicate entry
'Tax"...) called at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1501
[Tue Apr 13 00:19:38 2021] updatedatabase.pl:
DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::db do failed: Duplicate
entry 'TaxRates' for key "..., DBI::db=HASH(0x55deb509a688), undef) called
at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23442
I'm going to try pulling new images and such but FYI.
David Cook
Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20210413/a4a65db7/attachment.htm>
------------------------------
Subject: Digest Footer
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/
------------------------------
End of Koha-devel Digest, Vol 185, Issue 9
******************************************
NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.