Browse Source

Bug Fix : kohanews was broken when nodate or bad formatted supplied.

+ minor change in Languages in order not to have problems with eq

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Henri-Damien LAURENT 17 years ago
committed by Joshua Ferraro
parent
commit
789eab7d43
  1. 4
      C4/Languages.pm
  2. 8
      tools/koha-news.pl

4
C4/Languages.pm

@ -106,7 +106,7 @@ sub getTranslatedLanguages {
my @languages;
my $lang;
if ( $interface eq 'opac' ) {
if ($interface && $interface eq 'opac' ) {
$htdocs = C4::Context->config('opachtdocs');
if ( $theme and -d "$htdocs/$theme" ) {
(@languages) = _get_language_dirs($htdocs,$theme);
@ -119,7 +119,7 @@ sub getTranslatedLanguages {
return _get_final_languages($all_languages,@languages);
}
}
elsif ( $interface eq 'intranet' ) {
elsif ($interface && $interface eq 'intranet' ) {
$htdocs = C4::Context->config('intrahtdocs');
if ( $theme and -d "$htdocs/$theme" ) {
@languages = _get_language_dirs($htdocs,$theme);

8
tools/koha-news.pl

@ -103,9 +103,11 @@ else {
foreach my $new ( @$opac_news ) {
next unless $new->{'expirationdate'};
# next if $new->{'expirationdate'} eq '0000-00-00'; # now saved as null
if (Date_to_Days( split "-" ,$new->{'expirationdate'} ) < Date_to_Days(&Today) ){
$new->{'hasexpirated'} = 1;
}
$new->{'expirationdate'}=format_date_in_iso($new->{'expirationdate'});
my @date = split (/-/,$new->{'expirationdate'});
if ($date[0]*$date[1]*$date[2]>0 && Date_to_Days( @date ) < Date_to_Days(&Today) ){
$new->{'hasexpirated'} = 1;
}
}
$template->param(

Loading…
Cancel
Save