[Koha-bugs] [Bug 14969] Remove C4::Dates from serials/*.pl files

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 8 15:30:42 CET 2016


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

--- Comment #41 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Dobrica Pavlinusic from comment #40)
> Is there reason why we use
> 
> output_pref( { dt => dt_from_string( $subs->{startdate} ),     dateonly => 1
> } );
> 
> instead of
> 
> output_pref( { str => subs->{startdate}, dateonly => 1 } );
> 
> Second one has nice side-effect that it supports empty dates (which return
> as undef from database) in serial module. In our case, empty dates for
> planneddate and publisheddate produce application error base hash
> 
> { dt => dt_from_string( $line->{planneddate} ),   dateonly => 1 }
> 
> folds to
> 
> { dt , dateonly => 1 }
> 
> which makes dt = 'dateonly' which in turn is not object and result in
> application error.
> 
> Should I prepare separate bug for this change? Does it make sense?

Dobrica,
The removal of C4::Dates was quite long, and bug 15166 (which introduced the
str param) has been done during this process.
Of course we should remove *all* occurrences of output_pref({dt =
dt_from_string}); as it is dangerous.
It's on my todo list, I just need some motivation...
Please open the bug report and assign it to me, maybe it will bring me some
energy to do it :)

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


More information about the Koha-bugs mailing list