[Koha-bugs] [Bug 13851] Replace waiting holds logic in circulation.pl with Koha Objects

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 18 10:48:22 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13851

--- Comment #14 from Jonathan Druart <jonathan.druart at biblibre.com> ---
(In reply to Kyle M Hall from comment #12)
> > There is a lack of tests for new module added by this patch.
> 
> I'll add some unit tests!

Thanks!

> > ::: Koha/Hold.pm
> > @@ +45,5 @@
> > > +
> > > +sub biblio {
> > > +    my ($self) = @_;
> > > +
> > > +    $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );
> > 
> > Why not
> >     return $self->{_result}->biblio;
> > ?
> 
> That would return a DBIC restultset and not a Koha::Biblios object.

Yes, you are right, sorry.
We will have to create a method for each FK.
I don't have a better idea to suggest at the moment.

> > ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
> > @@ +763,5 @@
> > >  
> > > +            [% IF ( WaitingHolds ) %]
> > > +                <div id="holdswaiting" class="circmessage">
> > > +                    <h4>Holds waiting:</h4>
> > > +                    [% FOREACH w IN WaitingHolds %]
> > 
> > WaitingHolds is an array??
> > You have passed
> >     WaitingHolds => scalar $holds->waiting()
> > in the pl script.
> 
> WaitingHolds is a Koha::Holds object, which Template Toolkit can iterate
> over.

Ok, I thought you passed the number of holds, but actually it's a Koha::Holds
ref.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list