From: Sven Schöling Date: Thu, 5 May 2011 10:08:42 +0000 (+0200) Subject: Anstatt über "action_" zu croaken gibt der Base Controller jetzt eine freundliche... X-Git-Tag: release-2.7.0beta1~396^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=84e1c3e5742e8bf3e64b8265497dc4844bb03ccc;p=kivitendo-erp.git Anstatt über "action_" zu croaken gibt der Base Controller jetzt eine freundliche Meldung. --- 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',