Commit c28ac680 authored by Ahmad Alyasaki's avatar Ahmad Alyasaki Committed by Yahya Al Hamad
Browse files

Issue #3260556 by Ahmad Alyasaki: Hide wrapper plugin not working

parent f9c18d6e
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -22,10 +22,19 @@ class HideField extends LayoutFieldBase {
    if ($this->getConfiguration('hide')) {
      $children = Element::children($variables['content']);
      foreach ($children as $child) {
        $children_of_region = Element::children($variables['content'][$child]);
        if (!empty($children_of_region)) {
        $children_of_regions = Element::children($variables['content'][$child]);
        if (!empty($children_of_regions)) {
          foreach ($children_of_regions as $block_key) {
            $block = $variables['content'][$child][$block_key];
            if (!$block) {
              return;
            }
            $children_of_block = Element::children($block);
            if (!empty($children_of_block)) {
              return;
            }
          }
        }
      }

      $variables['attributes']['class'][] = 'hide-section';