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 {
'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',