[Koha-bugs] [Bug 22280] The ILL module assumes every status needs a next/previous status

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 5 16:31:46 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22280

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mtompset at hotmail.com

--- Comment #6 from M. Tompsett <mtompset at hotmail.com> ---
(In reply to Martin Renvoize from comment #5)
> Slightly confused by the status of this.. is Tomas's patch achieving the
> same end goal?

Actually, I believe it is correcting bad logic.

Next action (): 0 -- 0
Next action (undef): 0 -- 0
Next action (array): 1 -- 1 <-- the core_whatevs does have 'array'
Next action (nothing): 1 -- 0 <-- the core_whatevs doesn't have 'nothing'
Next action (ARRAY(0x55832fa45660)): 1 -- 0 <-- empty array
Next action (ARRAY(0x55832fa456f0)): 1 -- 0 <-- array with stuff in it
Next action (HASH(0x55832fa456a8)): 1 -- 0 <-- empty hash
Next action (HASH(0x55832fa456d8)): 1 -- 0 <-- hash with stuff in it

Though, I am uncomfortable with the:
    @{$back->{whatevs}}
because what if that is accidentally becoming an array of arrays? Which would
always trigger true, which would certainly explode.

I'd prefer:
    my @previous_actions = $back->{whatevs};
    for my $previous_action (@previous_actions};
just to make it abundantly clear and prevent any accidental double nesting.

Though to prevent noise, I'd also prefer:
    grep { defined $next_action && $next_action eq $_ } @core_whatevs;

NOTE: I didn't get the variable names exact, but it should be clear the idea
behind my comments.

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


More information about the Koha-bugs mailing list