Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've just updated from 6.x-1.0 to the latest dev and I'm getting the following error when editing my gmap views.
warning: Invalid argument supplied for foreach() in /public_html/sites/all/modules/gmap/gmap_plugin_style_gmap.inc on line 172.
I had been using the patch in #338587: Move views integration code to gmap_location module? to use individual longitude and latitude fields and that worked perfectly, but now the fields are blank (see attached image). The marker field is also blank.
I haven't made any changes to the latest dev code. Do I need to reapply the patch or is this now integrated?
Comment | File | Size | Author |
---|---|---|---|
gmap_error.jpg | 44.38 KB | sjf |
Comments
Comment #1
sjf CreditAttribution: sjf commentedStill getting this with the latest dev. I've removed all third-party patches to gmap and location code, regenerated my marker cache, cleared both Drupal and Views cache, even uninstalled and reinstalled gmap. I think this error first appeared when I accidentally tried to set an invalid views field as the marker. Below is the code at lines 169-175.
Comment #2
sjf CreditAttribution: sjf commentedOkay, I can reproduce this on a clean Drupal 6.10 install with latest devs of Location, GMap and Views. No other modules installed.
1. Create a new view and add a page display
2. Add Latitude and Longitude fields, setting them to decimal degrees
3. Change the page display style to gmap, then try to edit the style options. The error message appears and if you change the "Data Source" select list to "choose latitude and longitude fields", there are none to choose from.
Hope that helps. Anyone else having this problem?
Comment #3
tom_o_t CreditAttribution: tom_o_t commentedI can reproduce this problem - Drupal 6.10, clean install, Garland theme, using just latest gmap 6.x-1.x-dev, location 6.x-3.x-dev, and views 6.x-2.3
I added a new view, selected "location" as my view type. On the next screen I changed 'style' to Gmap, and as soon as I updated that I got the error people mentioned above -
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\map\sites\default\modules\contrib\gmap\gmap_plugin_style_gmap.inc on line 172.
As soon as I add a field to the view (e.g. node title) this error goes away and does not come back.
Comment #4
sjf CreditAttribution: sjf commentedInteresting... I have several other fields (Location:City, Node title, node post date etc.) in the view but the error message remains.
PS tried with both public and private file system.
Comment #5
andrewsuth CreditAttribution: andrewsuth commentedI did a clean install with the new release of GMaps Module from today (6.x-1.1-rc1) along with the latest Location Module (6.x-3.1-rc1) and the error message is still persisting.
I have noticed that both the Longitude and Latitude drop-downs fields are empty while the other drop-downs seems to be correct.
When I then make a page view with a path, I get the following error when trying to access the page:
Fatal error: Cannot access empty property in \sites\all\modules\gmap\gmap_plugin_style_gmap.inc on line 97
Does this help at all?
Comment #6
steveoliver CreditAttribution: steveoliver commentedI'm having the same issue. I've tried a few things which have not worked:
As the $options array (lines 169-175) still supplied no proper options...
On step 2, I of course got those options in my Latitude Field and Longitude Field drop-downs, but my Gmap still won't show...
I don't understand how actual (Lat/Long,etc.) fields show up as drop down options for Latitude Field and Longitude Field in View Defaults Style Settings, but not in Page Style Settings.
:/
-Steve
Comment #7
jeff h CreditAttribution: jeff h commentedCan I clarify a little what Steve has discovered, and mentioned in the previous comment (we've been talking on IRC)...
If you get the error, you are probably editing the gmap settings in the "page" display (or some display other than the defaults one). Even if the style: GMap is not overridden, you should edit its settings when on the Defaults display, and you won't get the error.
At least that is how it is for me.
Obviously the error still exists -- if you look at the foreach loop:
...$this->display->display_options['fields'] doesn't exist when you're on a display other than Defaults.
Jeff
Comment #8
bdragon CreditAttribution: bdragon commentedFinally, a way to reproduce. Thanks!
Comment #9
bdragon CreditAttribution: bdragon commentedOK, hopefully fixed. Could I get verification that this is working?
http://drupal.org/cvs?commit=182032
Comment #10
bdragon CreditAttribution: bdragon commentedComment #11
sjf CreditAttribution: sjf commentedThis does seem to have solved it for me. Thanks.
Comment #12
andrewsuth CreditAttribution: andrewsuth commentedBravo. Fixed the error for me
Comment #13
anthonybruno CreditAttribution: anthonybruno commentedFix worked for me as well.
Comment #14
rares CreditAttribution: rares commentedfixed for me too. I am having trouble with different markers for different roles though, which is probably unrelated. will try to find an issue about that or create one.
EDIT: distinct markers for user roles DO work
Comment #15
Sutharsan CreditAttribution: Sutharsan commented6.x-1.x-dev works for me too. I guess it is time for 'fixed'
Comment #17
lam3001 CreditAttribution: lam3001 commentedWe are having the same problem as poster #5:
Fatal error: Cannot access empty property in \sites\all\modules\gmap\gmap_plugin_style_gmap.inc on line 97
Drupal 6.11
GMap Module 6.x-1.1-rc1
Location 6.x-3.1-rc1
Views 6.x-2.5
So is this broken again? Or is there some other cause that we might have?
Comment #18
lam3001 CreditAttribution: lam3001 commentedComment #19
lam3001 CreditAttribution: lam3001 commentedComment #20
beautifulmindI can't fix this any how.
Subscribing.
Comment #21
nicholasThompsonI've updated from RC1 (6.x-1.1-rc1) to HEAD (6.x-1.x-dev) and this appears to have gone away - my Views embedded GMaps are working as expected now. Thanks...
Comment #22
dadderley CreditAttribution: dadderley commentedI came across this error. The gmap view worked with views-6.x-2.3 but shows this error when editing the view.
I did not notice this error (my bad)
I downloaded and installed gmap HEAD (6.x-1.x-dev) and this killed this error message:
warning: Invalid argument supplied for foreach()...gmap_plugin_style_gmap.inc on line 172
It all works.
When I upgraded views to views-6.x-2.5, I get the WSOD and this error:
Fatal error: Cannot access empty property in /home/thindig5/public_html/kzoocpcl/modules/views/modules/node.views.inc on line 670
Probably unrelated, but I only get this on the gmap view and no others.
Comment #23
chaosprinz CreditAttribution: chaosprinz commentedI had the same issue with the latest dev of gmap and views 2.5. After reading this isue, i downgraded to views2.3 and now it works fine. Thx a lot
Comment #24
dadderley CreditAttribution: dadderley commentedI really hope that this gets fixed as I cannot update the views module on 3 sites because of this.
Comment #25
sjf CreditAttribution: sjf commentedI haven't seen this problem since the last time I posted. I'm using Views 2.5 but I'm using the GMap -dev from March 14. I never got around to updating to the current April 18 -dev.
Sounds like there was a change between the March 14 and April 18 GMap -dev that broke this again.
Comment #26
beautifulmindI am using the same GMam-dev version and having problem with views 2.5 and 2.4, but still having problems.
Comment #28
Webster619 CreditAttribution: Webster619 commentedSorry to open this up again, but I am getting the same error:
warning: Invalid argument supplied for foreach() in /modules/gmap/gmap_plugin_style_gmap.inc on line 172.
Am I supposed to downgrade to views 2.3?
I'm using views 2.5 and gmap rc1.
Comment #29
Webster619 CreditAttribution: Webster619 commentedSorry to open this up again, but I am getting the same error:
warning: Invalid argument supplied for foreach() in /modules/gmap/gmap_plugin_style_gmap.inc on line 172.
Am I supposed to downgrade to views 2.3?
I'm using views 2.5 and gmap rc1.
Comment #30
chaosprinz CreditAttribution: chaosprinz commentedIt seems that views2.6 and the latest dev of gmap solve this problem. So upgrade your views to 2.6 and take the latest dev of gmap instead of rc1. For me it works.
Comment #31
Rustan CreditAttribution: Rustan commentedConfirming #30. I had the error, upgraded gmap from rc1 to dev from jun 9, error disappeared. Already had views2.6.
Comment #32
ChrisRut CreditAttribution: ChrisRut commented:subscribe:
Comment #33
chadd CreditAttribution: chadd commentedsubscribe
Comment #34
tengokuhad this error and fixed with last update.... funny working module version is 1.0 i had a 1.1rc somewere
Comment #35
garbanzito CreditAttribution: garbanzito commentedconfirming #34 above with slightly more detail -- i am working on an install profile and was getting the same error as the OP:
when editing a view using the Gmap style
when i set up my drush make file a few days ago, it was specifying
after getting the error, switched to
and reran and the error was gone
Comment #36
Danny EnglanderI am having the same exact issue with 6.x-1.x-dev from Jan 24 2010.
Comment #37
zmove CreditAttribution: zmove commentedSame issue : April 2010...
Comment #38
Macronomicus CreditAttribution: Macronomicus commentedThe prob is in 6.x-1.1-rc1 ... March 4, 2009
It is still fixed in the 6.x-1.x-dev 2010-Apr-09
The release numbers are a bit misleading, just did an update and installed 1.1 on accident thinking it was newer... why didnt I look at the date? lol
I am using views 3.x if that matters
Dont use 6.x-1.1-rc1
Comment #39
clemens.tolboom@Marcoon : tnx for noting the release dates. I was puzzling why 1.1-rc1 was not working as expected.
It would be nice to get this release unpublished ... drush picked it up for me :(
Trouble is the date span between the different versions ... 6.x-1.0 is _old_ but adviced.
Comment #40
Macronomicus CreditAttribution: Macronomicus commentedI will create a separate issue to dump that release.
Comment #42
AlanAtLarge CreditAttribution: AlanAtLarge commentedMe too: subscribe
Comment #43
jorgensa CreditAttribution: jorgensa commented