Posted by Smokesign on September 20, 2009 at 7:18pm
| Project: | GMap Module |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | bdragon |
| Status: | closed (fixed) |
| Issue tags: | PHP 5.3 |
Issue Summary
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.
Comments
#1
getting this error too after moving my development site to a new computer that has PHP 5.3.
#2
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
#3
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
#4
Attaching patch.
#5
Sorry newbee question...how do i apply this patch?
#6
the patch may fail on php4, see http://drupal.org/node/615058#comment-2211548
#7
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(
#8
#629196: GMAP PHP 5.3 compatibility marked duplicate.
I'll write a custom _invoke function to fix it.
#9
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.
#10
#684440: warning: Parameter 2 to gmap_gmap() expected to be a reference marked dupe.
#11
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.
#12
Same here. Tested both in PHP 5.2 & PHP 5.3
#13
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?
#14
re #13, unrelated, "parse_ini_file() has been disabled for security reasons" in your shared hosting. contact your hosting for more info.
#15
#11 Works fine, thanks!
#16
can this patch be added to the dev please.
#17
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
#18
subscribe (waiting for this gmap fix to be able to update site to php 5.3)
thank you
#19
Subscribe.
#20
Problem remains, unless you apply patch...
#21
Please commit this…
#22
rerolled patch on current CVS DRUPAL-6--1, the old one did apply but not all that cleanly.
#23
#22 tested on live site with PHP5.3. works OK, warnings gone. Please commit
#24
Subscribe
#25
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!
#26
Patch applied to 6.x-1.1-rc1 and tested on my development server running php 5.3 and issue resolved...
#27
Can not apply patch from #22 to 6.x-1.1-rc1:
$ patch -p0 -i gmap_invoke_cleanup_2.patchpatching 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');
#28
I applied rejected hunk from #22 manually.
Here is updated patch that applies without any problems to 6.x-1.1-rc1.
#29
@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.
#30
Ok, sorry.
#31
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
#32
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.
#33
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.
#34
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.
#35
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.
#36
i used the #22 patch and i got no error warning!
#37
You don't need the patch if you use the latest dev version as this has already been fixed.
#38
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.
#39
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.
#40
@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.
#41
Marked #747658: Gmaps warning as a duplicate of this issue.
#42
Automatically closed -- issue fixed for 2 weeks with no activity.
#43
Did it for me also, greetings, Martijn