From dc48a7e6a03cda495843a0d419143a11525443b6 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 14 Feb 2019 15:34:51 +0100 Subject: [PATCH] KickstartForm: do not fail on missing element --- application/forms/KickstartForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/forms/KickstartForm.php b/application/forms/KickstartForm.php index dec741cf..bbf4f4aa 100644 --- a/application/forms/KickstartForm.php +++ b/application/forms/KickstartForm.php @@ -199,8 +199,11 @@ class KickstartForm extends DirectorForm if (! isset($resourceConfig->charset) || ! in_array($resourceConfig->charset, array('utf8', 'utf8mb4')) ) { - $this->getElement('resource') - ->addError('Please change the encoding for the director database to utf8'); + if ($resource = $this->getElement('resource')) { + $resource->addError('Please change the encoding for the director database to utf8'); + } else { + $this->addError('Please change the encoding for the director database to utf8'); + } } $resource = $this->getResource();