From 96c96df6369e4f2a5c13f22c8d19657ea0f13d84 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 13 Jul 2017 12:59:23 +0200 Subject: [PATCH] Form: Don't transmit duplicate error messages Zend_Form::getMessages() already returns custom error messages, if there are any --- library/Icinga/Web/Form.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 054f7a89c..2beb09a5a 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -1169,9 +1169,7 @@ class Form extends Zend_Form $this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl(); } } elseif ($this->getIsApiTarget()) { - $this->getResponse()->json()->setFailData( - array_merge($this->getMessages(), $this->getErrorMessages()) - )->sendResponse(); + $this->getResponse()->json()->setFailData($this->getMessages())->sendResponse(); } } elseif ($this->getValidatePartial()) { // The form can't be processed but we may want to show validation errors though