From 5460465e076937323e440467fcb0ad3422067fb3 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 30 May 2017 16:37:55 +0200 Subject: [PATCH] Fix null->setDecorators() refs #2842 --- .../application/forms/Config/TransportConfigForm.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/forms/Config/TransportConfigForm.php b/modules/monitoring/application/forms/Config/TransportConfigForm.php index de7ad0c9d..3c41ec800 100644 --- a/modules/monitoring/application/forms/Config/TransportConfigForm.php +++ b/modules/monitoring/application/forms/Config/TransportConfigForm.php @@ -270,9 +270,6 @@ class TransportConfigForm extends ConfigForm parent::addSubmitButton(); if ($this->getSubForm('transport_form') instanceof ApiTransportForm) { - $this->getElement('btn_submit') - ->setDecorators(array('ViewHelper')); - $this->addElement( 'submit', 'transport_validation', @@ -296,8 +293,15 @@ class TransportConfigForm extends ConfigForm ) ); + $btnSubmit = $this->getElement('btn_submit'); + $elements = array('transport_validation', 'transport-progress'); + if ($btnSubmit !== null) { + // In the setup wizard $this is being used as a subform which doesn't have a submit button. + $btnSubmit->setDecorators(array('ViewHelper')); + array_unshift($elements, 'btn_submit'); + } $this->addDisplayGroup( - array('btn_submit', 'transport_validation', 'transport-progress'), + $elements, 'submit_validation', array( 'decorators' => array(