From 71451ec2a8800aadcfcb2bd9d07691615b4b5107 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Fri, 9 Dec 2016 12:52:21 +0100 Subject: [PATCH] Fixed: Nested form elements in AgentLinkObject prevent submit (bug#12429), thanks to Thorsten Eckel. --- CHANGES.md | 1 + Kernel/Output/HTML/Layout/LinkObject.pm | 12 +++++++++++- Kernel/Output/HTML/Templates/Standard/LinkObject.tt | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 31982032a2d..9cf37fe76e9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ #5.0.16 2017-??-?? + - 2016-12-09 Fixed bug#[12429](https://bugs.otrs.org/show_bug.cgi?id=12429) - Nested form elements in AgentLinkObject prevent submit, thanks to Thorsten Eckel. #5.0.15 2016-12-13 - 2016-12-07 Updated translations, thanks to all translators. diff --git a/Kernel/Output/HTML/Layout/LinkObject.pm b/Kernel/Output/HTML/Layout/LinkObject.pm index cfacba95126..ce8c0b7c62b 100644 --- a/Kernel/Output/HTML/Layout/LinkObject.pm +++ b/Kernel/Output/HTML/Layout/LinkObject.pm @@ -333,7 +333,9 @@ sub LinkObjectTableCreateComplex { # check if registered in SysConfig if ( - IsHashRefWithData($Config) + # AgentLinkObject not allowed because it would result in nested forms + $OriginalAction ne 'AgentLinkObject' + && IsHashRefWithData($Config) && $Config->{ $Block->{Blockname} } && grep { $OriginalAction eq $_ } @SettingsVisible ) @@ -355,6 +357,14 @@ sub LinkObjectTableCreateComplex { PrefKey => "LinkObject::ComplexTable-" . $Block->{Blockname}, ); + $LayoutObject->Block( + Name => 'ContentLargePreferencesForm', + Data => { + Name => $Block->{Blockname}, + NameForm => $Block->{Blockname}, + }, + ); + $LayoutObject->Block( Name => $Preferences{Name} . 'PreferencesItem' . $Preferences{Block}, Data => { diff --git a/Kernel/Output/HTML/Templates/Standard/LinkObject.tt b/Kernel/Output/HTML/Templates/Standard/LinkObject.tt index 960fa93ed26..b30cefce643 100644 --- a/Kernel/Output/HTML/Templates/Standard/LinkObject.tt +++ b/Kernel/Output/HTML/Templates/Standard/LinkObject.tt @@ -115,6 +115,7 @@ Core.UI.RegisterToggleTwoContainer($('#linkobject-' + Core.App.EscapeSelector('[ [% RenderBlockEnd("TableComplexBlockActionRow") %]
+[% RenderBlockStart("ContentLargePreferencesForm") %] +[% RenderBlockEnd("ContentLargePreferencesForm") %]