Unable to display notifications marked as done (DBI)
Concerned version
Version: %2.0.7
Platform: (Nginx/uWsgi/PG)
Summary
When trying to display Done notifications, a 500 error is thrown by server.
Logs
Lemonldap::NG::CommonMon Dec 23 16:13:21 2019 - [uwsgi-perl error] Month '12' out of range 0..11 at /usr/share/perl5/Lemonldap/NG/Common/Notifications/DBI.pm line 223.
Backends used
PostGres
Possible fixes
sub getDone {
my ($self) = @_;
$self->_execute( 'SELECT * FROM '
. $self->dbiTable
. ' WHERE done IS NOT NULL ORDER BY done' );
my $result;
while ( my $h = $self->sth->fetchrow_hashref() ) {
my @t = split( /\D+/, $h->{date} );
$t[1]--; # <-- Fixed here
my $done =
timelocal( $t[5] || 0, $t[4] || 0, $t[3] || 0, $t[2], $t[1], $t[0] );
$result->{"$h->{date}#$h->{uid}#$h->{ref}"} =
{ notified => $done, uid => $h->{uid}, ref => $h->{ref}, };
}
$self->logger->warn( $self->sth->err() ) if ( $self->sth->err() );
return $result;
}