I see the above error x times in my logs after we updated to PHP 5.3
My host pointed me to the following:
modules/gmap/gmap.module:function gmap_gmap($op, &$map)
the & shouldn't be there
I removed it and everything is fine again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nirad’s picture

getting this error too after moving my development site to a new computer that has PHP 5.3.

nirad’s picture

switched to PHP 5.2.11 and the error went away. This seems like it may be a problem with Drupal core, and not with Gmap. See: http://drupal.org/node/586228

kim.pepper’s picture

This isn't a problem with Drupal core, its an incorrect use of a reference parameter when its a value parameter. See #360605: PHP 5.3 Compatibility

kim.pepper’s picture

FileSize
537 bytes

Attaching patch.

amishra’s picture

Sorry newbee question...how do i apply this patch?

joetsuihk’s picture

the patch may fail on php4, see http://drupal.org/node/615058#comment-2211548

Nardos Tessema’s picture

Thanks a lot! It worked for me. I removed the ampersand as stated in the description and now everything is fine.

? 5_3_compat.patch
Index: gmap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap.module,v
retrieving revision 1.101
diff -u -p -r1.101 gmap.module
--- gmap.module 17 Apr 2009 18:31:59 -0000 1.101
+++ gmap.module 5 Oct 2009 01:14:28 -0000
@@ -76,7 +76,7 @@ function gmap_theme() {
/**
* Implementation of hook_gmap().
*/
-function gmap_gmap($op, &$map) {
+function gmap_gmap($op, $map) {
switch ($op) {
case 'macro':
return array(

bdragon’s picture

Version: 6.x-1.1-rc1 » 6.x-1.x-dev

#629196: GMAP PHP 5.3 compatibility marked duplicate.

I'll write a custom _invoke function to fix it.

bdragon’s picture

Assigned: Unassigned » bdragon
Status: Active » Needs review
FileSize
5 KB

Here's the "correct" way to do it.

I'd like this tested with both PHP 5.3 and PHP 5.2 before I commit it.

bdragon’s picture

pivica’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
5.82 KB

I have rerolled patch from #9 against latest gmap dev version. Tested on both PHP 5.2 and PHP 5.3 - its seems everything is working fine and no more 'reference' warning error for PHP 5.3.

ari-meetai’s picture

Same here. Tested both in PHP 5.2 & PHP 5.3

ragavendra_bn’s picture

Getting the below warnings in /admin/settings/gmap

* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: parse_ini_file() has been disabled for security reasons in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 229.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 234.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.
* warning: Invalid argument supplied for foreach() in /home/fashion/public_html/bandhana/sites/all/modules/gmap/gmap_markerinfo.inc on line 246.

Using PHP5.3. Should be related to PHP5.3
How to fix this?

joetsuihk’s picture

re #13, unrelated, "parse_ini_file() has been disabled for security reasons" in your shared hosting. contact your hosting for more info.

marvil07’s picture

Issue tags: +PHP 5.3

#11 Works fine, thanks!

spacereactor’s picture

can this patch be added to the dev please.

spacereactor’s picture

again can this #11 patch be added to dev, it very troublesome with each new upgrade since my hosting server is running on php 5.3

ansorg’s picture

subscribe (waiting for this gmap fix to be able to update site to php 5.3)
thank you

Peng.Pif’s picture

Subscribe.

Carlos Miranda Levy’s picture

Problem remains, unless you apply patch...

mikl’s picture

Please commit this…

hutch’s picture

FileSize
5.52 KB

rerolled patch on current CVS DRUPAL-6--1, the old one did apply but not all that cleanly.

iva2k’s picture

#22 tested on live site with PHP5.3. works OK, warnings gone. Please commit

Bobuido’s picture

Subscribe

Anonymous’s picture

same problem with upgrade to PHP 5.3.

maybe rather unwisely i tried #22 on gmap 6.x-1.1-rc1 (DRUPAL-6--1-0), and it worked fine except for 1 hunk, which on inspection i couldnt see any problem with, and applied manually, and it worked.

and now the error is gone, thanks!

michaeldhart’s picture

Patch applied to 6.x-1.1-rc1 and tested on my development server running php 5.3 and issue resolved...

vgarvardt’s picture

Can not apply patch from #22 to 6.x-1.1-rc1:

$ patch -p0 -i gmap_invoke_cleanup_2.patch 
patching file gmap.module
Hunk #1 succeeded at 47 (offset 3 lines).
Hunk #2 succeeded at 74 (offset 3 lines).
Hunk #3 FAILED at 947.
1 out of 3 hunks FAILED -- saving rejects to file gmap.module.rej
patching file gmap_macro_builder.module
patching file gmap_parse_macro.inc
patching file gmap_settings_ui.inc
Hunk #1 succeeded at 78 (offset -1 lines).
Hunk #2 succeeded at 171 (offset -10 lines).
Hunk #3 succeeded at 216 (offset -10 lines).
$ cat gmap.module.rej 
--- gmap.module	8 Apr 2010 13:40:19 -0000	1.104.2.5
+++ gmap.module	24 May 2010 16:00:27 -0000
@@ -947,10 +967,7 @@
   // @@@ Bdragon sez: Yeah, would be nice, but hard to guarantee functionality. Not everyone uses the static markerloader.
   $o = '<div style="' . implode('; ', $style) . ';" id="' . $element['#id'] . '"' . drupal_attributes($element['#attributes']) . '>' . t('Javascript is required to view this map.') . '</div>';
 
-  // $map can be manipulated by reference.
-  foreach (module_implements('gmap') as $module) {
-    call_user_func_array($module . '_gmap', array('pre_theme_map', &$map));
-  }
+  gmap_module_invoke('pre_theme_map', $map);
 
   if (isset($mapids[$element['#map']])) {
     drupal_set_message(t('Duplicate map detected! GMap does not support multiplexing maps onto one MapID! GMap MapID: %mapid', array('%mapid' => $element['#map'])), 'error');
vgarvardt’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
4.98 KB

I applied rejected hunk from #22 manually.
Here is updated patch that applies without any problems to 6.x-1.1-rc1.

mikl’s picture

Status: Needs review » Reviewed & tested by the community

@vgarvard its not supposed to apply against the release (6.x-1.1-rc1), its supposed to apply against the latest dev version. There, the patch from #22 applies cleanly.

vgarvardt’s picture

Ok, sorry.

bdragon’s picture

Status: Reviewed & tested by the community » Fixed

Fixed (I hope -- I'm a bit rusty with my tools at the moment), thanks!
http://drupal.org/cvs?commit=377296
http://drupal.org/cvs?commit=377302
http://drupal.org/cvs?commit=377304

spacereactor’s picture

Status: Fixed » Active

sorry to open again, but i just install gmap and i having this error
warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in /home/mystie/public_html/includes/module.inc on line 483.

This only happen to my server using php 5.3 and my local test server is php 5.2 is ok

I have to manually add the patch from #22 to remove the error.

marvil07’s picture

Status: Active » Fixed

spacereactor: fixed means commited to the dev version, not on the official release. please make sure you have the 1.x-dev version. maybe you can also want to read Status settings for an issue

Marking back to fixed.

spacereactor’s picture

i using 6.x-1.x-dev of 2010-Jun-09 and having the error, that why i manually adding the #22 patch. I not using the official release.

rooby’s picture

I have checked the cvs commits and the latest dev version and the fix is definitely in there already.

Dev releases only update every 12 hours so it is possible you didn't get the latest version if it was too soon after the commit.

If you download the dev version again now it should be working without having to manually patch.

mormmam’s picture

i used the #22 patch and i got no error warning!

rooby’s picture

You don't need the patch if you use the latest dev version as this has already been fixed.

ghousemaideen’s picture

1)I have installed the openpublish and executed well. but, i have received error given below. how to solve this error. I need brief explainations. please guide me immediatly... and,

2)How to convert the drupal database to openpublish. i need some brief explaination. pls..

3)where is Gmap folder.

warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in E:\xampp\htdocs\openpublish\includes\module.inc on line 483.

Regards,
ghouse.

ghousemaideen’s picture

1)I have installed the openpublish and executed well. but, i have received error given below. how to solve this error. I need brief explainations. please guide me immediatly...

warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in E:\xampp\htdocs\openpublish\includes\module.inc on line 483. and,

2)How to convert the drupal database to openpublish. i need some brief explaination. pls..

3)where is Gmap folder.

warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in E:\xampp\htdocs\openpublish\includes\module.inc on line 483.

Regards,
ghouse.

rooby’s picture

@ghousemaideen:
1. I have not used openpublish and I know nothing about it.
What version of gmap are you using? To avoid the error reported in this issue you currently need to use the latest dev version 6.x-1.x-dev (you will also have to use location 6.x-3.x-dev).

2. This is the support queue for gmap, not openpublish. If you need help with openpublish I suggest using it's issue queues. If you check the openpublish issue queues and documentation you might find the information you want is already available.

3. The gmap folder is wherever you put it when you installed it. If you have access to your database use this sql to find out (or just look around your file system):

SELECT * FROM system WHERE name = 'gmap';

That will give you the installation information for the gmap module, which includes the patch to the module.

rooby’s picture

Marked #747658: Gmaps warning as a duplicate of this issue.

Status: Fixed » Closed (fixed)

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

Summit’s picture

Did it for me also, greetings, Martijn