diff --git a/dist.ini b/dist.ini index 78cdd70..2e63dfc 100644 --- a/dist.ini +++ b/dist.ini @@ -13,7 +13,7 @@ travis_status = 1 installer = ModuleBuild [Prereqs] -Mojolicious = 3.33 +Mojolicious = 5.81 Template = 2.18 [Author::Plicease::Thanks] diff --git a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm index a608001..0a5dd51 100644 --- a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm +++ b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm @@ -206,9 +206,8 @@ sub _template_content { if(defined $options) { $data = $self->renderer->get_data_template($options); } else { - my $loader = Mojo::Loader->new; foreach my $class (@{ $self->renderer->classes }) { - $data = $loader->data($class, $t); + $data = Mojo::Loader::data_section($class, $t); last if $data; } } diff --git a/t/deep_recursion.t b/t/deep_recursion.t deleted file mode 100644 index 6be3944..0000000 --- a/t/deep_recursion.t +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; - -#BEGIN { $ENV{MOJO_MODE}='testing'; }; - -use utf8; - -use Test::More; - -use Mojolicious::Lite; -use Test::Mojo; -use File::Temp qw( tempdir ); -use File::Spec; - -if($Mojolicious::VERSION >= 4.0) -{ - plan skip_all => 'test broken in mojo 4.0'; -} -else -{ - plan tests => 3; -} - -# Send log to tmp file so that it doesn't clutter up the screen. -app->log->level('fatal'); -app->log->path(do { - File::Spec->catfile(tempdir(CLEANUP => 1), 'mojo.log'); -}); - -plugin 'tt_renderer' => {template_options => { COMPILE_DIR => tempdir( CLEANUP => 1 ) }}; - -get '/exception' => sub { die }; - -#say app->mode; -#app->start; -#exit; - -my $t = Test::Mojo->new; - -$t->app->renderer->default_handler('tt'); - -my $deep_recursion = 0; - -do { - local $SIG{__WARN__} = sub { - my $warning = shift; - if($warning =~ /Deep recursion/) { - $deep_recursion = 1; - die $warning; - } - }; - $t->get_ok('/exception') - ->status_is(500); -}; - -ok !$deep_recursion, 'no deep recursion'; - -__DATA__ - -@@ exception.development.html.tt -[% 1 + % %] - -@@ exception.html.tt -[% 1 + % %] - -@@ exception.testing.html.tt -[% 1 + % %]