From 9d0a52c82fc07833cd8377b201c9183199783ab3 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 27 Jun 2023 22:48:38 +0200 Subject: [PATCH] fix timefmt load into session position --- lib/MojoFacets/Data.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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'); } -- 2.20.1