From 7c5f4e408e06771eebb5378b21ef071dab360343 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 11 Mar 2013 11:21:02 +0100 Subject: [PATCH] Presenter-Template-Plugin: bei nicht existierenden Funktionen warnen --- SL/Template/Plugin/P.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SL/Template/Plugin/P.pm b/SL/Template/Plugin/P.pm index d2f442354..44eeb436d 100644 --- a/SL/Template/Plugin/P.pm +++ b/SL/Template/Plugin/P.pm @@ -29,7 +29,12 @@ sub AUTOLOAD { my $method = $AUTOLOAD; $method =~ s/.*:://; - return '' unless $presenter->can($method); + return '' if $method eq 'DESTROY'; + + if (!$presenter->can($method)) { + $::lxdebug->message(LXDebug::WARN(), "SL::Presenter has no method named '$method'!"); + return ''; + } splice @args, -1, 1, %{ $args[-1] } if @args && (ref($args[-1]) eq 'HASH'); -- 2.20.1