From 945f55ed318654e0051f6d88559d7b33bd79d972 Mon Sep 17 00:00:00 2001 From: Brian Duggan Date: Thu, 26 Feb 2015 15:29:43 -0500 Subject: [PATCH] changes for recent Mojolicious --- Build.PL | 2 +- lib/Tuba.pm | 2 +- lib/Tuba/Array.pm | 6 +++--- lib/Tuba/Article.pm | 2 +- lib/Tuba/Book.pm | 2 +- lib/Tuba/Contributor.pm | 2 +- lib/Tuba/Controller.pm | 30 +++++++++++++++--------------- lib/Tuba/Exterm.pm | 4 ++-- lib/Tuba/Figure.pm | 8 ++++---- lib/Tuba/File.pm | 2 +- lib/Tuba/Finding.pm | 8 ++++---- lib/Tuba/GcmdKeyword.pm | 2 +- lib/Tuba/Generic.pm | 2 +- lib/Tuba/Image.pm | 2 +- lib/Tuba/Instrument.pm | 2 +- lib/Tuba/InstrumentInstance.pm | 2 +- lib/Tuba/Model.pm | 2 +- lib/Tuba/ModelRun.pm | 4 ++-- lib/Tuba/Organization.pm | 6 +++--- lib/Tuba/Person.pm | 10 +++++----- lib/Tuba/Platform.pm | 2 +- lib/Tuba/Project.pm | 2 +- lib/Tuba/Publication.pm | 4 ++-- lib/Tuba/Reference.pm | 6 +++--- lib/Tuba/Region.pm | 2 +- lib/Tuba/Report.pm | 2 +- lib/Tuba/Scenario.pm | 2 +- lib/Tuba/Table.pm | 12 ++++++------ 28 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Build.PL b/Build.PL index d504c797..f0605597 100644 --- a/Build.PL +++ b/Build.PL @@ -50,7 +50,7 @@ my $builder = Module::Build::Database->new( 'LWP::UserAgent' => 0, 'Number::Bytes::Human' => 0, 'Mojolicious::Plugin::YamlConfig' => 0, - 'Mojolicious' => '5.16', + 'Mojolicious' => '5.82', 'Number::Format' => 0, 'YAML::Syck' => 0, 'YAML::XS' => 0, diff --git a/lib/Tuba.pm b/lib/Tuba.pm index 32c28770..d5bd0925 100644 --- a/lib/Tuba.pm +++ b/lib/Tuba.pm @@ -483,7 +483,7 @@ sub startup { $r->post('/calculate_url' => sub { my $c = shift; my $for = $c->param('_route_name'); - my $route = $c->app->routes->lookup($for) or return $c->render_not_found; + my $route = $c->app->routes->lookup($for) or return $c->reply->not_found; my $params = $c->req->params->to_hash; delete $params->{_route_name}; my $got = $c->url_for($for, $params); diff --git a/lib/Tuba/Array.pm b/lib/Tuba/Array.pm index 58594fe9..a730d064 100644 --- a/lib/Tuba/Array.pm +++ b/lib/Tuba/Array.pm @@ -29,7 +29,7 @@ sub show { my $meta = Array->meta; my $object = Array->new( identifier => $identifier ) ->load( speculative => 1, with => [qw/tables/] ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $meta); $c->SUPER::show(@_); @@ -49,7 +49,7 @@ sub update_rel_form { sub update_rel { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $object->meta->error_mode('return'); $c->stash(object => $object); $c->stash(meta => $object->meta); @@ -120,7 +120,7 @@ sub _process_rows { sub update { my $c = shift; - my $obj = $c->_this_object or return $c->render_not_found; + my $obj = $c->_this_object or return $c->reply->not_found; if (my $in = $c->_process_rows) { if (ref $in eq 'ARRAY') { $c->stash(computed_params => { rows => $in } ); diff --git a/lib/Tuba/Article.pm b/lib/Tuba/Article.pm index 3e2e8dfc..5ede1067 100644 --- a/lib/Tuba/Article.pm +++ b/lib/Tuba/Article.pm @@ -26,7 +26,7 @@ sub doi { my $doi = $c->stash('doi'); my $object = Article->new( doi => $doi )->load( speculative => 1) - or return $c->render_not_found; + or return $c->reply->not_found; $c->redirect_to('show_article' => { article_identifier => $object->identifier } ); } diff --git a/lib/Tuba/Book.pm b/lib/Tuba/Book.pm index 4df0e0ab..5a6b538d 100644 --- a/lib/Tuba/Book.pm +++ b/lib/Tuba/Book.pm @@ -40,7 +40,7 @@ sub update_rel_form { sub update { my $c = shift; $c->stash(tab => 'update_form'); - my $book = $c->_this_object or return $c->render_not_found; + my $book = $c->_this_object or return $c->reply->not_found; if ($c->param('convert_into_report')) { return $c->update_error("Not converting because this book has an ISBN, and reports don't have ISBNs.") if $book->isbn && length($book->isbn); my $report = Report->new( diff --git a/lib/Tuba/Contributor.pm b/lib/Tuba/Contributor.pm index a995d6c6..f2b07c7f 100644 --- a/lib/Tuba/Contributor.pm +++ b/lib/Tuba/Contributor.pm @@ -11,7 +11,7 @@ use Tuba::DB::Objects qw/-nicknames/; sub show { my $c = shift; my $con = Contributor->new( id => scalar $c->stash('contributor_identifier') )->load( speculative => 1) - or return $c->render_not_found; + or return $c->reply->not_found; my $format = $c->stash('format'); if (my $p = $con->person) { my $uri = $p->uri($c); diff --git a/lib/Tuba/Controller.pm b/lib/Tuba/Controller.pm index 672bb913..1b6281e3 100644 --- a/lib/Tuba/Controller.pm +++ b/lib/Tuba/Controller.pm @@ -189,7 +189,7 @@ sub set_title { sub show { my $c = shift; - my $object = $c->stash('object') or return $c->render_not_found; + my $object = $c->stash('object') or return $c->reply->not_found; my $meta = $c->stash('meta') || $object->meta; $c->stash(meta => $meta) unless $c->stash('meta'); my $table = $meta->table; @@ -301,7 +301,7 @@ sub render_not_found_or_redirect { $sql .= " and " if $sql; $sql .= " row_data->'$name' = \$".@bind; } - return $c->render_not_found unless $identifier; + return $c->reply->not_found unless $identifier; my $sth = $c->db->dbh->prepare(< 1 }); select changed_fields->'$identifier_column' @@ -312,10 +312,10 @@ select changed_fields->'$identifier_column' SQL my $got = $sth->execute(@bind); my $rows = $sth->fetchall_arrayref; - return $c->render_not_found unless $rows && @$rows; + return $c->reply->not_found unless $rows && @$rows; my $replacement = $rows->[0][0]; my $url = $c->req->url; - $url =~ s{/$table_name/$identifier(?=/|$|\.)}{/$table_name/$replacement} or return $c->render_not_found; + $url =~ s{/$table_name/$identifier(?=/|$|\.)}{/$table_name/$replacement} or return $c->reply->not_found; return $c->redirect_to($url); } @@ -575,7 +575,7 @@ sub update_form { my $c = shift; my $controls = $c->stash('controls') || {}; $c->stash(controls => { $c->_default_controls, %$controls } ); - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $object->meta); $c->stash(cols => $c->_order_columns(meta => $object->meta)); @@ -608,7 +608,7 @@ Generic update_prov_form. sub update_prov_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $object->meta); my $pub = $object->get_publication(autocreate => 1) or return $c->render(text => $object->meta->table.' is not a publication'); @@ -635,7 +635,7 @@ Update the provenance for this object. sub update_prov { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(tab => 'update_prov_form'); $c->stash(object => $object); $c->stash(meta => $object->meta); @@ -727,7 +727,7 @@ be on this page, e.g. sub update_rel_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; my $controls = $c->stash('controls') || {}; $c->stash(controls => { $c->_default_rel_controls, %$controls } ); my $meta = $object->meta; @@ -746,7 +746,7 @@ Form for updating files. sub update_files_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $object->meta); $c->render("update_files_form"); @@ -760,7 +760,7 @@ Form for updating contributors. sub update_contributors_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $object->meta); $c->render("update_contributors_form"); @@ -775,7 +775,7 @@ Update the files. sub update_files { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(tab => "update_files_form"); my $pub = $object->get_publication(autocreate => 1) or @@ -989,7 +989,7 @@ sub update_contributors { sub _update_pub_many { my $c = shift; my $what = shift; - my $obj = $c->_this_object or return $c->render_not_found; + my $obj = $c->_this_object or return $c->reply->not_found; my $pub = $obj->get_publication(autocreate => 1); my $cwhat = "Tuba::DB::Object::$what"; my $dwhat = decamelize($what); @@ -1158,7 +1158,7 @@ sub can_set_replacement { sub update { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; my $next = $object->uri($c,{tab => 'update_form'}); my %pk_changes; my %new_attrs; @@ -1270,7 +1270,7 @@ Generic delete sub remove { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $object->meta->error_mode('return'); $object->delete or return $c->render_exception($object->error); return $c->render(text => 'ok'); @@ -1306,7 +1306,7 @@ Generic history of changes to an object. sub history { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; my $pk = $object->meta->primary_key; my @columns = $pk->column_names; diff --git a/lib/Tuba/Exterm.pm b/lib/Tuba/Exterm.pm index db33da17..83519e23 100644 --- a/lib/Tuba/Exterm.pm +++ b/lib/Tuba/Exterm.pm @@ -44,7 +44,7 @@ sub find { context => $c->stash('context'), term => $c->stash('term'), ); - $term->load(speculative => 1) or return $c->render_not_found; + $term->load(speculative => 1) or return $c->reply->not_found; my $gcid = $term->gcid; $c->res->headers->location($gcid); $c->respond_to( @@ -62,7 +62,7 @@ sub remove { context => $c->stash('context'), term => $c->stash('term'), ); - $term->load(speculative => 1) or return $c->render_not_found; + $term->load(speculative => 1) or return $c->reply->not_found; $term->delete or return $c->render_exception($term->error); return $c->render(text => 'ok'); } diff --git a/lib/Tuba/Figure.pm b/lib/Tuba/Figure.pm index 5414ac1e..38b6f323 100644 --- a/lib/Tuba/Figure.pm +++ b/lib/Tuba/Figure.pm @@ -78,7 +78,7 @@ sub show { if (!$c->stash('chapter_identifier') && $object->chapter_identifier) { $c->stash(chapter_identifier => $object->chapter_identifier); } - return $c->render_not_found unless $c->verify_consistent_chapter($object); + return $c->reply->not_found unless $c->verify_consistent_chapter($object); $c->stash(object => $object); $c->stash(meta => Figure->meta); @@ -87,8 +87,8 @@ sub show { sub update_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; - $c->verify_consistent_chapter($object) or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; + $c->verify_consistent_chapter($object) or return $c->reply->not_found; $c->SUPER::update_form(@_); } @@ -109,7 +109,7 @@ sub update_rel_form { sub update_rel { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $c->stash(tab => "update_rel_form"); my $json = $c->req->json; diff --git a/lib/Tuba/File.pm b/lib/Tuba/File.pm index 2b0bb55e..4d653450 100644 --- a/lib/Tuba/File.pm +++ b/lib/Tuba/File.pm @@ -10,7 +10,7 @@ use Tuba::DB::Objects qw/-nicknames/; sub list { my $c = shift; - return $c->render_not_found; + return $c->reply->not_found; $c->stash(objects => Files->get_objects(with_objects => 'publications', page => $c->page)); my $count = Files->get_objects_count; $c->set_pages($count); diff --git a/lib/Tuba/Finding.pm b/lib/Tuba/Finding.pm index 8b28c4c4..e0e923bf 100644 --- a/lib/Tuba/Finding.pm +++ b/lib/Tuba/Finding.pm @@ -56,8 +56,8 @@ sub set_title { sub update_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; - $c->verify_consistent_chapter($object) or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; + $c->verify_consistent_chapter($object) or return $c->reply->not_found; $c->SUPER::update_form(@_); } @@ -78,12 +78,12 @@ sub show { return $c->redirect_to($object->uri_with_format($c)) if $object; }; - return $c->render_not_found unless $object; + return $c->reply->not_found unless $object; if (!$c->stash('chapter_identifier') && $object->chapter_identifier) { $c->stash(chapter_identifier => $object->chapter_identifier); } - return $c->render_not_found unless $c->verify_consistent_chapter($object); + return $c->reply->not_found unless $c->verify_consistent_chapter($object); $c->stash(object => $object); $c->SUPER::show(@_); diff --git a/lib/Tuba/GcmdKeyword.pm b/lib/Tuba/GcmdKeyword.pm index 2e39c224..9f835519 100644 --- a/lib/Tuba/GcmdKeyword.pm +++ b/lib/Tuba/GcmdKeyword.pm @@ -19,7 +19,7 @@ sub list { sub show { my $c = shift; - my $kw = $c->_this_object or $c->render_not_found; + my $kw = $c->_this_object or $c->reply->not_found; $c->stash(object => $kw); $c->SUPER::show(@_); } diff --git a/lib/Tuba/Generic.pm b/lib/Tuba/Generic.pm index b93b54b4..9fccda04 100644 --- a/lib/Tuba/Generic.pm +++ b/lib/Tuba/Generic.pm @@ -17,7 +17,7 @@ sub show { my $identifier = $c->stash('generic_identifier'); my $object = Generic->new( identifier => $identifier )->load( speculative => 1) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->SUPER::show(@_); } diff --git a/lib/Tuba/Image.pm b/lib/Tuba/Image.pm index 781d8a5f..8786504f 100644 --- a/lib/Tuba/Image.pm +++ b/lib/Tuba/Image.pm @@ -48,7 +48,7 @@ sub update_rel_form { sub update_rel { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; $object->meta->error_mode('return'); $c->stash(object => $object); $c->stash(meta => $object->meta); diff --git a/lib/Tuba/Instrument.pm b/lib/Tuba/Instrument.pm index d711a0dd..7e7f11fc 100644 --- a/lib/Tuba/Instrument.pm +++ b/lib/Tuba/Instrument.pm @@ -21,7 +21,7 @@ sub show { my $identifier = $c->stash('instrument_identifier'); my $meta = Instrument->meta; my $object = Instrument->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/InstrumentInstance.pm b/lib/Tuba/InstrumentInstance.pm index 4446155f..da6a418f 100644 --- a/lib/Tuba/InstrumentInstance.pm +++ b/lib/Tuba/InstrumentInstance.pm @@ -24,7 +24,7 @@ sub show { platform_identifier => $platform_identifier, instrument_identifier => $instrument_identifier )->load(speculative => 1) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $object->meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/Model.pm b/lib/Tuba/Model.pm index c55fee82..449f784a 100644 --- a/lib/Tuba/Model.pm +++ b/lib/Tuba/Model.pm @@ -19,7 +19,7 @@ sub show { my $identifier = $c->stash('model_identifier'); my $object = Model->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => Model->meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/ModelRun.pm b/lib/Tuba/ModelRun.pm index 210f8892..85114026 100644 --- a/lib/Tuba/ModelRun.pm +++ b/lib/Tuba/ModelRun.pm @@ -19,7 +19,7 @@ sub show { my $identifier = $c->stash('model_run_identifier'); my $object = ModelRun->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => ModelRun->meta); $c->SUPER::show(@_); @@ -73,7 +73,7 @@ sub lookup { return $c->redirect_with_error( show => $error ); } $run->load( speculative => 1 ) or do { - return $c->render_not_found; + return $c->reply->not_found; }; return $c->redirect_to("/model_run/".$run->identifier); } diff --git a/lib/Tuba/Organization.pm b/lib/Tuba/Organization.pm index 3294635d..bfd8c0e4 100644 --- a/lib/Tuba/Organization.pm +++ b/lib/Tuba/Organization.pm @@ -131,13 +131,13 @@ sub update_form { sub lookup_name { my $c = shift; - my $name = $c->req->json->{name} or return $c->render_not_found; + my $name = $c->req->json->{name} or return $c->reply->not_found; my $org = Organization->new(name => $name)->load(speculative => 1); if ($org) { my $uri = $org->uri($c); return $c->redirect_to($uri); } - return $c->render_not_found; + return $c->reply->not_found; } sub merge { @@ -196,7 +196,7 @@ sub contributions { map [ $_->stringify(short => 1), $_ ], @objs; $c->stash(objs => \@objs); - my $roletype = RoleType->new(identifier => $role_identifier)->load(speculative => 1) or return $c->render_not_found; + my $roletype = RoleType->new(identifier => $role_identifier)->load(speculative => 1) or return $c->reply->not_found; $c->stash(role => $roletype ); $c->respond_to( json => { json => [ map $_->as_tree(c => $c, bonsai => 1), @objs ] }, diff --git a/lib/Tuba/Person.pm b/lib/Tuba/Person.pm index edd8c6a5..fc39357c 100644 --- a/lib/Tuba/Person.pm +++ b/lib/Tuba/Person.pm @@ -37,7 +37,7 @@ sub redirect_by_name { my $c = shift; my $name = $c->stash('name'); my @pieces = split /-/, $name; - return $c->render_not_found unless @pieces==2; + return $c->reply->not_found unless @pieces==2; my $front = Persons->get_objects( query => [first_name => $pieces[0], last_name => $pieces[1]], limit => 10 @@ -48,7 +48,7 @@ sub redirect_by_name { ); my @found = (@$front, @$back); - return $c->render_not_found unless @found; + return $c->reply->not_found unless @found; if (@found==1) { return $c->redirect_to('show_person', { person_identifier => $found[0]->id } ); } @@ -65,7 +65,7 @@ sub redirect_by_name { sub redirect_by_orcid { my $c = shift; - my $person = Person->new(orcid => $c->stash('orcid'))->load(speculative => 1) or return $c->render_not_found; + my $person = Person->new(orcid => $c->stash('orcid'))->load(speculative => 1) or return $c->reply->not_found; return $c->redirect_to('show_person', { person_identifier => $person->id } ); } @@ -92,7 +92,7 @@ sub lookup_name { if ($matches && @$matches==1) { return $c->redirect_to($matches->[0]->uri($c)); } - return $c->render_not_found unless @$matches; + return $c->reply->not_found unless @$matches; return $c->render(json => { matches => [ map $_->as_tree(bonsai => 1), @$matches ] } ); } @@ -195,7 +195,7 @@ sub contributions { map [ $_->stringify(short => 1), $_ ], @objs; $c->stash(objs => \@objs); - my $roletype = RoleType->new(identifier => $role_identifier)->load(speculative => 1) or return $c->render_not_found; + my $roletype = RoleType->new(identifier => $role_identifier)->load(speculative => 1) or return $c->reply->not_found; $c->stash(role => $roletype ); $c->respond_to( json => { json => [ map $_->publication->to_object->as_tree(c => $c, bonsai => 1), @$maps ] }, diff --git a/lib/Tuba/Platform.pm b/lib/Tuba/Platform.pm index 92651137..b98a6ff3 100644 --- a/lib/Tuba/Platform.pm +++ b/lib/Tuba/Platform.pm @@ -21,7 +21,7 @@ sub show { my $identifier = $c->stash('platform_identifier'); my $meta = Platform->meta; my $object = Platform->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/Project.pm b/lib/Tuba/Project.pm index 30f12a39..f8e985a9 100644 --- a/lib/Tuba/Project.pm +++ b/lib/Tuba/Project.pm @@ -19,7 +19,7 @@ sub show { my $identifier = $c->stash('project_identifier'); my $meta = Project->meta; my $object = Project->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => $meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/Publication.pm b/lib/Tuba/Publication.pm index 9d851e45..0abd0a40 100644 --- a/lib/Tuba/Publication.pm +++ b/lib/Tuba/Publication.pm @@ -12,8 +12,8 @@ sub show { my $c = shift; my $identifier = $c->stash('publication_identifier'); my $pub = Publication->new( id => $identifier )->load( speculative => 1) - or return $c->render_not_found; - my $object = $pub->to_object or return $c->render_not_found; + or return $c->reply->not_found; + my $object = $pub->to_object or return $c->reply->not_found; return $c->redirect_to($object->uri($c)->to_abs); } diff --git a/lib/Tuba/Reference.pm b/lib/Tuba/Reference.pm index 68e74d4b..e4b98381 100644 --- a/lib/Tuba/Reference.pm +++ b/lib/Tuba/Reference.pm @@ -228,7 +228,7 @@ sub update_rel_form { sub update_rel { my $c = shift; - my $reference = $c->_this_object or return $c->render_not_found; + my $reference = $c->_this_object or return $c->reply->not_found; my $report = $reference->publication->to_object; undef $report unless $report->meta->table eq 'report'; @@ -294,12 +294,12 @@ sub lookup { my $c = shift; my $record_number = $c->stash('record_number'); - $record_number =~ /^[0-9]+$/ or return $c->render_not_found; + $record_number =~ /^[0-9]+$/ or return $c->reply->not_found; my $found = References->get_objects(query => [ \"attrs->'_record_number' = ${record_number}::varchar" ], limit => 10 ); unless ($found && @$found) { - return $c->render_not_found; + return $c->reply->not_found; } if (@$found > 1) { return $c->respond_to( diff --git a/lib/Tuba/Region.pm b/lib/Tuba/Region.pm index 5d6abd89..d3ad32cf 100644 --- a/lib/Tuba/Region.pm +++ b/lib/Tuba/Region.pm @@ -19,7 +19,7 @@ sub list { sub show { my $c = shift; - my $kw = $c->_this_object or $c->render_not_found; + my $kw = $c->_this_object or $c->reply->not_found; $c->stash(object => $kw); $c->SUPER::show(@_); } diff --git a/lib/Tuba/Report.pm b/lib/Tuba/Report.pm index e58e60ab..c3914fd5 100644 --- a/lib/Tuba/Report.pm +++ b/lib/Tuba/Report.pm @@ -42,7 +42,7 @@ order by transaction_id limit 1 SQL my $got = $sth->execute($identifier); my $rows = $sth->fetchall_arrayref; - return $c->render_not_found unless $rows && @$rows; + return $c->reply->not_found unless $rows && @$rows; my $replacement = $rows->[0][0]; my $url = $c->req->url; $url =~ s{/report/$identifier(?=/|$)}{/report/$replacement}; diff --git a/lib/Tuba/Scenario.pm b/lib/Tuba/Scenario.pm index 0c7fcddb..2095c633 100644 --- a/lib/Tuba/Scenario.pm +++ b/lib/Tuba/Scenario.pm @@ -19,7 +19,7 @@ sub show { my $identifier = $c->stash('scenario_identifier'); my $object = Scenario->new( identifier => $identifier ) ->load( speculative => 1 ) - or return $c->render_not_found; + or return $c->reply->not_found; $c->stash(object => $object); $c->stash(meta => Scenario->meta); $c->SUPER::show(@_); diff --git a/lib/Tuba/Table.pm b/lib/Tuba/Table.pm index c50834d4..4196de03 100644 --- a/lib/Tuba/Table.pm +++ b/lib/Tuba/Table.pm @@ -63,12 +63,12 @@ sub show { )->load(speculative => 1, with => [qw/chapter arrays/]); return $c->redirect_to($object->uri_with_format($c)) if $object; }; - return $c->render_not_found unless $object; + return $c->reply->not_found unless $object; if (!$c->stash('chapter_identifier') && $object->chapter_identifier) { $c->stash(chapter_identifier => $object->chapter_identifier); } - return $c->render_not_found unless $c->verify_consistent_chapter($object); + return $c->reply->not_found unless $c->verify_consistent_chapter($object); $c->stash(object => $object); $c->stash(meta => $meta); @@ -86,7 +86,7 @@ sub redirect_to_identifier { 'ordinal' => $table_number, ] ); - return $c->render_not_found unless $found && @$found; + return $c->reply->not_found unless $found && @$found; return $c->redirect_to( 'show_table' => { table_identifier => $found->[0]->identifier } ); } @@ -107,14 +107,14 @@ sub update_rel_form { sub update_form { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; - $c->verify_consistent_chapter($object) or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; + $c->verify_consistent_chapter($object) or return $c->reply->not_found; $c->SUPER::update_form(@_); } sub update_rel { my $c = shift; - my $object = $c->_this_object or return $c->render_not_found; + my $object = $c->_this_object or return $c->reply->not_found; my $next = $object->uri($c,{tab => 'update_rel_form'}); $object->meta->error_mode('return'); if (my $new = $c->param('new_array')) {