From 9ae8de2df1d3f766a70d78b316bbd57eaaf4c6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20F=C3=BCsslin?= Date: Fri, 27 Apr 2018 11:17:24 +0200 Subject: [PATCH] updated checkbox error state: no control-label needed according to bootstrap docs --- src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php b/src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php index 11d77c4..0ec0bc4 100644 --- a/src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php +++ b/src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php @@ -218,7 +218,7 @@ protected function renderElement(ElementInterface $oElement, $sLabelPosition = n if ($oElement->getOption('validation-state') || $oElement->getMessages()) { if (empty($aLabelAttributes['class'])) { $aLabelAttributes['class'] = 'control-label'; - } elseif (!preg_match('/(\s|^)control-label(\s|$)/', $aLabelAttributes['class'])) { + } elseif (!preg_match('/(\s|^)control-label(\s|$)/', $aLabelAttributes['class']) && $sElementType !== 'checkbox') { $aLabelAttributes['class'] = trim($aLabelAttributes['class'] . ' control-label'); } }