From: Dobrica Pavlinusic Date: Tue, 27 Jun 2023 20:48:38 +0000 (+0200) Subject: fix timefmt load into session position X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=9d0a52c82fc07833cd8377b201c9183199783ab3;hp=4ca66cf62bd23168ad354a15efa9e79544a249a0;p=MojoFacets.git fix timefmt load into session position --- diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index eceafb7..c715f6f 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -264,10 +264,6 @@ sub _load_path { $loaded->{ $path } = $info; $self->_save( $path ) unless $info->{generated}; - my $timefmt_path = $self->_permanent_path( 'timefmt' ); - if ( -e $timefmt_path ) { - $self->session( 'timefmt', read_file $timefmt_path ); - } } @@ -293,6 +289,13 @@ sub load { $self->session( 'path' => $path ); + my $timefmt_path = $self->_permanent_path( 'timefmt' ); + if ( -e $timefmt_path ) { + my $timefmt = read_file $timefmt_path; + $self->session( 'timefmt', $timefmt ); + warn "timefmt = ", $timefmt; + } + my $redirect_to = '/data/items'; $self->session( 'header' => $loaded->{$path}->{header} ); @@ -429,6 +432,7 @@ sub columns { return $self->redirect_to('/data/items'); } elsif ( ! $self->session('header') ) { + return $self->redirect_to('/'); return $self->redirect_to('/data/load'); }