I have this code here:
<div class="<?php echo $this->class; ?> block <?php echo $this->field('style')->value(); ?> <?php echo $this->field('columns')->value(); ?> <?php echo $this->field('margin_top')->value(); ?> <?php echo $this->field('margin_bottom')->value(); ?><?php if($this->field('margin_top_mobile')->value()): ?> <?php echo $this->field('margin_top_mobile')->value(); ?><?php endif; ?><?php if($this->field('margin_bottom_mobile')->value()): ?> <?php echo $this->field('margin_bottom_mobile')->value(); ?><?php endif; ?>"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<div class="ce_featurelist_inside">
<ul>
<?php foreach($this->group('list') as $i => $fields): ?>
<li class="item item_<?php echo $i; ?>">
<?php if($this->field('link#'.$i)->value()): ?>
<a href="<?php echo $this->field('link#'.$i)->value(); ?>" title="<?php echo $this->field('link#'.$i)->option('titleText'); ?>"<?php if($this->field('link#'.$i)->option('target')): ?> target="_blank"<?php endif; ?><?php if($this->field('link#'.$i)->option('lightbox')): ?><?php echo $this->field('link#'.$i)->option('lightbox'); ?><?php endif; ?>>
<?php endif; ?>
<?php if($this->field('font_icon#'.$i)->value()): ?><i class="icon <?php echo $this->field('font_icon#'.$i)->value(); ?>"></i><?php endif; ?>
<?php if($this->field('image_icon#'.$i)->value()): ?><div class="icon"><?php echo $this->field('image_icon#'.$i)->html(); ?></div><?php endif; ?>
<span><?php echo $this->field('item#'.$i)->value(); ?></span>
<?php if($this->field('link#'.$i)->value()): ?>
</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
The problem is that I have this error : "Warning: Invalid argument supplied for foreach()" I have:
- PHP version 7.3.27
- Contao Manager 1.4.2
- Contao 4.7.6 (API version 2)
When I run the dubug mode on test.com/app_dev.php It shows me that error :
"ErrorException: Warning: Invalid argument supplied for foreach() at templates/layout/customelement_featurelist.html5:4 "
The website works properly but I can't update anything.
Is there any idea of what happening?