Hello,

I have installed the preset module but I am getting the following warning error while enabled the module (warning: Invalid argument supplied for foreach() in /var/aegir/drupal_platforms/sundaram6.20/sites/music.brahma.neokrish.co.in/modules/presets/presets.admin.inc on line 166). I am using PHP 5.3.2-1ubuntu4.5 server. Please assist me in finding out whats going wrong.

Comments

pinin4fjords’s picture

I'm experiencing the same error. I'm using a basic (non-aegir) setup on Fedora 11 with Drupal 6.19 and php 5.2.13. Would appreciate any pointers.

toddwshaffer’s picture

I'm also experiencing the same error. Everything in presets is working as expected, just a nice red error box exposed at the top of the modules display page (the error only displays there).

Drupal 6.2
GoDaddy (god knows what type of server, it's just a test installation)

I'll be installing this module on an Ubuntu Amazon EC2 server later today, I'll report back on whether or not the error reports there, and with it which version of OS/PHP/Apache/etc I'm running.

savinsur’s picture

Same issue here;

Invalid argument supplied for foreach() in /var/www/vhosts/xxxxxxxxxx.com/httpdocs/sites/all/modules/presets/presets.admin.inc on line 48

randallknutson’s picture

I'll take a look into this. I thought I had it fixed but I guess not.

solanadesign’s picture

Anyone have a clue on how to fix this one? I just installed Presets and it's throwing the same error.

alfthecat’s picture

+1 Getting the same error

sravanglitter’s picture

Assigned: sravanglitter » Unassigned

Wrongly assigned to myself

zibretni’s picture

This is caused by an empty array.

If you put :
if ($preset_info['modules']>0) {
before :
foreach($preset_info['modules'] as $module => $info) {

and :
{
before :
return $modules;

Then the error dissapear.

But I did not figured out why there was an empty error.

DolfAndringa’s picture

I am getting the same error here with a fully updated D6 site. Is there any activity on this bug?

loopy29’s picture

Same problem here...

Observer123’s picture

also got warning

ndwilliams3’s picture

rc5 shows a commit to fix the issue. I updated to rc5, but I am still getting the error.

BrockBoland’s picture

Status: Needs work » Closed (duplicate)

This is definitely related to #1090576: Cannot use object of type stdClass as array... module line 74: modules that are not implementing hook_presets() have their own modulename_presets() functions defined for their own use, and return values that are not expected. As such, presets_get_presets() returns invalid data.

I'm marking this as a dupe. Please see comment #5 on that other issue for more detail.