From 84e1c3e5742e8bf3e64b8265497dc4844bb03ccc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 5 May 2011 12:08:42 +0200 Subject: [PATCH] =?utf8?q?Anstatt=20=C3=BCber=20"action=5F"=20zu=20croaken?= =?utf8?q?=20gibt=20der=20Base=20Controller=20jetzt=20eine=20freundliche?= =?utf8?q?=20Meldung.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Base.pm | 10 +++++++--- locale/de/all | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index d50d519b7..152fbb779 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -174,9 +174,13 @@ sub _dispatch { my $action = first { $::form->{"action_${_}"} } @actions; my $sub = "action_${action}"; - $self->_run_hooks('before', $action); - $self->$sub(@_); - $self->_run_hooks('after', $action); + if ($self->can($sub)) { + $self->_run_hooks('before', $action); + $self->$sub(@_); + $self->_run_hooks('after', $action); + } else { + $::form->error($::locale->text('Oops. No valid action found to dispatch. Please report this case to the Lx-Office team.')); + } } sub _template_obj { diff --git a/locale/de/all b/locale/de/all index fc36154d7..0fb3c7155 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1227,6 +1227,7 @@ $self->{texts} = { 'On Order' => 'Ist bestellt', 'One or more Perl modules missing' => 'Ein oder mehr Perl-Module fehlen', 'Only due follow-ups' => 'Nur fällige Wiedervorlagen', + 'Oops. No valid action found to dispatch. Please report this case to the Lx-Office team.' => '', 'Open' => 'Offen', 'Open Amount' => 'Offener Betrag', 'Open a further Lx-Office Window or Tab' => 'Neues Fenster bzw. Tab öffnen', -- 2.20.1