Closed (fixed)
Project:
Flexiblock
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2006 at 13:38 UTC
Updated:
4 Oct 2006 at 17:11 UTC
I'm trying to set up Flexiblock with PHPTemplate on 4.6.6. I've inserted the code given in the Flexi documentation into the template:
<?php $blocks = theme('flexiblock_blocks', 2); ?>
<?php foreach ( $blocks as $block ) { ?>
<h3><?php echo $block['subject'] ?></h3>
<?php echo $block['content'] ?>
<?php } ?>
I get the following error message:
Invalid argument supplied for foreach() - /path/to/page.tpl.php - line 60.
The plain HTML works perfectly:
theme('flexiblock_html', 2)
Comments
Comment #1
robertgarrigos commentedYou can suppress this error message by changing each foreach function from this:
to this:
(http://www.php.net/manual/en/control-structures.foreach.php#43653)
Or you can change your ini setting for error_reporting to a lower level
Comment #2
robertgarrigos commentedAlso, look at this comment: http://drupal.org/requirements#comment-160035
I close this because in fact is not a bug within the module's code but within its example code (commented) to use in the templates, although it might be nice to have that example code fixed also.