Loading includes/webform.theme.inc +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ * Theme hooks, preprocessor, and suggestions. */ use Drupal\Core\Render\Element; use Drupal\file\Entity\File; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\NestedArray; Loading Loading @@ -576,7 +577,7 @@ function webform_preprocess_file_managed_file(&$variables) { } // Don't alter hidden file upload input. if (isset($element['upload']['#access']) && $element['upload']['#access'] === FALSE) { if (!Element::isVisibleElement($element['upload'])) { return; } Loading modules/webform_attachment/src/Controller/WebformAttachmentController.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\webform_attachment\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\ElementInfoManagerInterface; use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\WebformInterface; Loading Loading @@ -89,7 +90,7 @@ class WebformAttachmentController extends ControllerBase implements ContainerInj // Make sure element #access is not FALSE. // The #private property is used to to set #access to FALSE. // @see \Drupal\webform\Entity\Webform::initElementsRecursive if (isset($element['#access']) && $element['#access'] === FALSE) { if (!Element::isVisibleElement($element)) { throw new AccessDeniedHttpException(); } Loading modules/webform_image_select/src/Element/WebformImageSelectElementImages.php +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\webform_image_select\Element; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\Element\FormElement; use Drupal\Core\Url; use Drupal\webform\Entity\WebformOptions as WebformOptionsEntity; Loading Loading @@ -130,8 +131,7 @@ class WebformImageSelectElementImages extends FormElement { $value = $custom_value; } $has_access = (!isset($element['#access']) || $element['#access'] === TRUE); if ($element['#required'] && empty($value) && $has_access) { if (Element::isVisibleElement($element) && $element['#required'] && empty($value)) { WebformElementHelper::setRequiredError($element, $form_state); } Loading modules/webform_options_custom/src/Element/WebformOptionsCustom.php +2 −4 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\Xss; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\Element\FormElement; use Drupal\Core\Render\Markup; use Drupal\webform\Element\WebformCompositeFormElementTrait; Loading Loading @@ -222,9 +223,6 @@ class WebformOptionsCustom extends FormElement implements WebformOptionsCustomIn public static function validateWebformOptionsCustom(&$element, FormStateInterface $form_state, &$complete_form) { $value = NestedArray::getValue($form_state->getValues(), $element['select']['#parents']); // Determine if the element is visible. (#access !== FALSE) $has_access = (!isset($element['#access']) || $element['#access'] === TRUE); // Determine if the element has multiple values. $is_multiple = (empty($element['#multiple'])) ? FALSE : TRUE; Loading @@ -237,7 +235,7 @@ class WebformOptionsCustom extends FormElement implements WebformOptionsCustomIn } // Validate on elements with #access. if ($has_access && !empty($element['#required']) && $is_empty) { if (Element::isVisibleElement($element) && !empty($element['#required']) && $is_empty) { WebformElementHelper::setRequiredError($element, $form_state); } Loading modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php +2 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\OptGroup; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Render\Element; use Drupal\webform\Element\WebformAjaxElementTrait; use Drupal\webform\Element\WebformEntityTrait; use Drupal\webform\Element\WebformMessage; Loading Loading @@ -532,7 +533,7 @@ class OptionsLimitWebformHandler extends WebformHandlerBase implements WebformOp */ public static function validateElement(&$element, FormStateInterface $form_state, &$complete_form) { // Skip if element is not visible. if (isset($element['#access']) && $element['#access'] === FALSE) { if (!Element::isVisibleElement($element)) { return; } Loading Loading
includes/webform.theme.inc +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ * Theme hooks, preprocessor, and suggestions. */ use Drupal\Core\Render\Element; use Drupal\file\Entity\File; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\NestedArray; Loading Loading @@ -576,7 +577,7 @@ function webform_preprocess_file_managed_file(&$variables) { } // Don't alter hidden file upload input. if (isset($element['upload']['#access']) && $element['upload']['#access'] === FALSE) { if (!Element::isVisibleElement($element['upload'])) { return; } Loading
modules/webform_attachment/src/Controller/WebformAttachmentController.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\webform_attachment\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\ElementInfoManagerInterface; use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\WebformInterface; Loading Loading @@ -89,7 +90,7 @@ class WebformAttachmentController extends ControllerBase implements ContainerInj // Make sure element #access is not FALSE. // The #private property is used to to set #access to FALSE. // @see \Drupal\webform\Entity\Webform::initElementsRecursive if (isset($element['#access']) && $element['#access'] === FALSE) { if (!Element::isVisibleElement($element)) { throw new AccessDeniedHttpException(); } Loading
modules/webform_image_select/src/Element/WebformImageSelectElementImages.php +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\webform_image_select\Element; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\Element\FormElement; use Drupal\Core\Url; use Drupal\webform\Entity\WebformOptions as WebformOptionsEntity; Loading Loading @@ -130,8 +131,7 @@ class WebformImageSelectElementImages extends FormElement { $value = $custom_value; } $has_access = (!isset($element['#access']) || $element['#access'] === TRUE); if ($element['#required'] && empty($value) && $has_access) { if (Element::isVisibleElement($element) && $element['#required'] && empty($value)) { WebformElementHelper::setRequiredError($element, $form_state); } Loading
modules/webform_options_custom/src/Element/WebformOptionsCustom.php +2 −4 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\Xss; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\Element\FormElement; use Drupal\Core\Render\Markup; use Drupal\webform\Element\WebformCompositeFormElementTrait; Loading Loading @@ -222,9 +223,6 @@ class WebformOptionsCustom extends FormElement implements WebformOptionsCustomIn public static function validateWebformOptionsCustom(&$element, FormStateInterface $form_state, &$complete_form) { $value = NestedArray::getValue($form_state->getValues(), $element['select']['#parents']); // Determine if the element is visible. (#access !== FALSE) $has_access = (!isset($element['#access']) || $element['#access'] === TRUE); // Determine if the element has multiple values. $is_multiple = (empty($element['#multiple'])) ? FALSE : TRUE; Loading @@ -237,7 +235,7 @@ class WebformOptionsCustom extends FormElement implements WebformOptionsCustomIn } // Validate on elements with #access. if ($has_access && !empty($element['#required']) && $is_empty) { if (Element::isVisibleElement($element) && !empty($element['#required']) && $is_empty) { WebformElementHelper::setRequiredError($element, $form_state); } Loading
modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php +2 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\OptGroup; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Render\Element; use Drupal\webform\Element\WebformAjaxElementTrait; use Drupal\webform\Element\WebformEntityTrait; use Drupal\webform\Element\WebformMessage; Loading Loading @@ -532,7 +533,7 @@ class OptionsLimitWebformHandler extends WebformHandlerBase implements WebformOp */ public static function validateElement(&$element, FormStateInterface $form_state, &$complete_form) { // Skip if element is not visible. if (isset($element['#access']) && $element['#access'] === FALSE) { if (!Element::isVisibleElement($element)) { return; } Loading