* warning: Invalid argument supplied for foreach() in /var/www/html/dev04/sites/all/modules/token/token.module on line 385.
* warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/html/dev04/includes/bootstrap.inc on line 857.

When cloning preset and entering Edit preset form.

Comments

henrijs.seso’s picture

And cloned preset is not working. Default map works, cloned preset won't.

Misconfiguration. Nothing is broken, just annoying :)

zzolo’s picture

Category: bug » support

Hi @LavaMeTender ak... Thanks for the information. None of these warnings can be automatically assumed to be from this module. Marking as support request until actual bug is found.

Brian294’s picture

I am getting the same token error:
warning: Invalid argument supplied for foreach() in /data/www/jiffyclip/sites/all/modules/token/token.module on line 385.

the error occurs when I go to:
/admin/build/openlayers/presets/add
/admin/build/openlayers/presets/my_preset_name/edit

Token version: 6.x-1.15
OpenLayers: 6.x-2.0-alpha10

Brian294’s picture

Here is what's going on in watchdog:

	openlayers	11/06/2010 - 00:33	Layer test_preset not found.	Administrator	
	openlayers	11/06/2010 - 00:33	Layer test_preset not found.	Administrator	
	php        	11/06/2010 - 00:33	Invalid argument supplied for foreach() in ...	Administrator	
	openlayers	11/06/2010 - 00:33	Layer not found.	Administrator	
	openlayers	11/06/2010 - 00:33	Layer not found.	Administrator	
	openlayers	11/06/2010 - 00:33	Layer add not found.	Administrator	
	openlayers	11/06/2010 - 00:33	Layer add not found.	Administrator	
	php        	11/06/2010 - 00:33	Invalid argument supplied for foreach() in ...	Administrator
orbmantell’s picture

Category: support » bug

I am getting the same "Invalid argument supplied for foreach()" error on my install of openlayers, I am running a clean drupal 6.20 install with cck, views, token, ctools, and openlayers. I was getting this error on a dev site, and set up this clean install to try to isolate any interference from other modules. Given that the problem still occurs I am assuming this is an openlayers issue, and not an issue of incompatibility with another module.

kle’s picture

Status: Active » Patch (to be ported)

Sorry - no Patchfile but after I changed this, the error is gone:

In openlayers_geocoder.token.inc I moved line 20
- $list = array();
just before line 19
- foreach ($layers as $layer_name => $layer) {

otherwise $list is NULL (and $tokens['openlayers data'] should not be NULL)

Grretings from Hamburg !

kardave’s picture

Project: Openlayers » OpenLayers Geocoder
Version: 6.x-2.0-alpha10 » 6.x-2.0-alpha5
Component: OpenLayers API » Code
StatusFileSize
new747 bytes

A made the patch. It works for me.

David

steinmb’s picture

Version: 6.x-2.0-alpha5 » 6.x-2.x-dev

Does this commit cleanly against the current dev.?

steinmb’s picture

Title: 2 errors - token and bootstrap » Token - Invalid argument supplied for foreach warnings
Status: Patch (to be ported) » Needs review
StatusFileSize
new693 bytes

Unable to reproduce this error (Token 1.x), anyone now how to? But then again, defining the array inside the foreach loops does not look right. Rerolling.

steinmb’s picture

Status: Needs review » Fixed

Like I wrote in #9 was I unable to reproduce it, but the small patch make totally sense so I went ahead and committed it:
http://drupalcode.org/project/openlayers_geocoder.git/commit/21b207a

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.