From 959519e8c109b88e01d18a36384cab82f7a5d21e Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Mon, 17 Jan 2022 16:38:53 +0200 Subject: [PATCH] Bug 29684: add honeypot to catch other warnings in the future Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- C4/Templates.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Templates.pm b/C4/Templates.pm index d41c9b534e..53e1dc5073 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -113,6 +113,12 @@ sub output { $vars->{opaclayoutstylesheet} = C4::Context->preference('opaclayoutstylesheet'); + if(exists $self->{VARS}{lang}) { + warn "Preventing \$template->lang='" . ($self->{vars}{lang}//'-undef-') + . "' to be overwritten by template->{VARS}{lang}='" . ($self->{VARS}{lang}//'-undef-') . "'"; + delete $self->{VARS}{lang}; + } + # add variables set via param to $vars for processing $vars = { %$vars, %{ $self->{VARS} } }; -- 2.39.5