Posted by spacereactor on March 5, 2010 at 7:54am
22 followers
| Project: | Location |
| Version: | 6.x-3.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | nilu5233 |
| Status: | closed (fixed) |
| Issue tags: | PHP 5.3 |
Issue Summary
click on site config -> location -> Geocoding options got the error
warning: Parameter 1 to theme_location_geocoding_options() expected to be a reference, value given in /home/mysite/public_html
I using
php 5.3.1
MySQL database 5.0.89
GMap Module 6.x-1.x-dev (2010-Jan-24)
Drupal 6.16
Location 6.x-3.x-dev (2010-Jan-23)
Comments
#1
another error when i click Map Links
warning: Parameter 1 to theme_location_map_link_options() expected to be a reference, value given in /home/mysite/public_html/includes/theme.inc on line 656.
#2
anyone know how to fix, is this php 5.3 related problem?
warning: Parameter 1 to theme_location_map_link_options() expected to be a reference, value given in /home/mysite/public_html/includes/theme.inc
#3
I am not the author of this code and do not know what the intention was, but the code on line 253 in location.admin.inc:
function theme_location_map_link_options(&$form) {should I think befunction theme_location_map_link_options($form) {The same for line 274
function theme_location_geocoding_options(&$form) {needs the "&" removing.I cannot test this as I do not have php v5.3.x running anywhere.
Please test this and if it gets rid of the error and the theming still works then provide a patch for the maintainer's consideration.
Hope this helps
#4
thank, i remove the two "&" and error message doesn't appear anymore. Can the location Maintainer team confirm and add it to the dev.
#5
Hello,
I am encounter the follwoing error when accessing the page.
warning: Parameter 1 to theme_field() expected to be a reference, value given in C:\xampp\htdocs\vhosts\default\htdocs\includes\theme.inc on line 170.
Code for the function theme is as follows..
function theme() {
static $functions;
$args = func_get_args();
$function = array_shift($args);
if (!isset($functions[$function])) {
$functions[$function] = theme_get_function($function);
}
if ($functions[$function]) {
return call_user_func_array($functions[$function], $args);
}
}
I am getting error while returning the value.
Appreciate if somebody can help me with this..
#6
i not sure if this is location problem. where an when this error occur?
warning: Parameter 1 to theme_field() expected to be a reference, value given in C:\xampp\htdocs\vhosts\default\htdocs\includes\theme.inc on line 170.
#7
Sometime &$ is needed in the arg list so that whatever is being passed in can be *altered*
... I think ...
lets keep part of the error message in the issue title so others getting this error will find this issue too.
#8
My (somewhat tenuous) understanding of this is that the &$ should be present in the function definition but not in the call.
so
function myfunc(&$thingy) {// do something to $thingy
.....
}
and
$thingy = "something";myfunc($thingy);
// $thingy has been altered by myfunc()
That is how I have used it and it works, but I don't know if that way generates an error in PHP5.3.x
#9
Yes, I think that is how I have seen it work in my recent looks into APIs....
#10
I don't have this issue however I have seen this error in many other places so I might be able to help with some insight. It usually comes from the function "call_user_func_array" being used, often from an "invoke" such as "module_invoke_all". Reason is this:
Anyway, if this is not what's happening, sorry, it just looks like it would be. However, if this is the case check your version of Drupal because of one of the version around 6.13'ish the core was updated to be PHP 5.3 compatible and that may be all you need to make it work correctly.
#11
My errors was:
1. Click on - Administer › Site configuration › Location > Map links
"warning: Parameter 1 to theme_location_map_link_options() expected to be a reference, value given in C:\strony_www\PHP\xampp\htdocs\drupal-6.16\includes\theme.inc on line 656."
2. Administer › Site configuration › Location > Geocoding Options
"warning: Parameter 1 to theme_location_geocoding_options() expected to be a reference, value given in C:\strony_www\PHP\xampp\htdocs\drupal-6.16\includes\theme.inc on line 656."
I removed ampersand & like in #3 and now I don't see any warnings, I think it work.
[EDITED]:
PHP 5.3.1
Drupal 6.16
#12
The #3 works also form me!
I had also theme problems, solved with this workaround, thanks a lot!
#13
Please (if you have found the fix works for you or if you are posting a new review) include what your php version (and drupal version) is. I believe you can find that easily by looking under reports -> status report .
Also someone please create a patch for this suggested fix (in #3).
[edited to fix mis-spellings]
#14
Here is a patch on latest CVS, it removes the '&' from the theme functions theme_location_geocoding_options() and theme_location_map_link_options()
I'm pretty sure this will work, I see no reason to pass a $form object to a theme by reference, it's just display munging.
#15
#16
Hi...
#3 worked out for me...was haunted by the same warning message...
thanks...
#17
#3 did it for me too.
#18
lobolo and hip, as the fix from #3 is in the patch in #15, please try to apply that patch and review it so it can be committed as a proper fix to the module. :)
#19
I actually applied the patch and it did the trick.
+1 to become a proper fix ;-)
#20
Patch in #14 worked for me.
#21
#14 works for me.
#22
The solution is good. Let's commit this please.
#23
Perfecto. This patch worked great for me. Well done.
#24
when i enter the location-> map linking
it shows me this warning
warning: Parameter 1 to theme_location_map_link_options() expected to be a reference, value given in /var/www/edu/includes/theme.inc on line 656.
i find many ways to solve but it still can't remove it
i see the way "I removed ampersand & like in #3 and now I don't see any warnings, "
but i don't understand what should i remove in theme.inc 656
it doesn't have the signal "&" and "#3"
sorry my english is very poor
thank you
#25
in location.admin.inc, line 292: function theme_location_map_link_options(&$form)
try removing the '&'
#26
thank you to reply my question
but i remove the "&", the warning is still on the page
so, what i can do it!?
#27
There is no need to be modifying the $form variable in those theme functions anyway.
I have committed hutch's fix to all branches.
I also did the same for theme_location_latitude_dms() and theme_location_longitude_dms() in the D7 branch.
http://drupal.org/cvs?commit=473646
http://drupal.org/cvs?commit=473642
http://drupal.org/cvs?commit=473654
#28
Marked #685792: warning: Parameter 1 to theme_location_map_link_options() expected to be a reference as dupliucate of this issue.
#29
Automatically closed -- issue fixed for 2 weeks with no activity.
#30
I receive, "warning: Parameter 1 to theme_location_map_link_options() expected to be a reference, value given in /var/www/ijec/includes/theme.inc on line 668."
I am using PHP version 5.3.5 and Drupal 6.22
Here is what the error points to:
666: if (isset($info['function'])) {667: // The theme call is a function.
668: $output = call_user_func_array($info['function'], $args);
669: }
670: else {
671: // The theme call is a template.
672: $variables = array(
673: 'template_files' => array()
674: );
675: if (!empty($info['arguments'])) {
676: $count = 0;
677: foreach ($info['arguments'] as $name => $default) {
678: $variables[$name] = isset($args[$count]) ? $args[$count] : $default;
679: $count++;
680: }
681: }
#31
@aceinthehole:
This has been fixed in the dev version.
A new release is a bit overdue actually. I will get one out soonish.
Until then though the dev version will stop that error.
There are also a number of other useful fixes in there.
#32
Got it -- thanks Rooby!
#33
Still get the warning: Parameter 1 to theme_location_geocoding_options() expected to be a reference, value given in error
By the way. Can this bug explain why im not getting the coordinates in my view even though i manage to get the adress and other location data?
#34
Marcus 78, I'm having the same problem.
The exact same warning, and my map center is in the middle of the map, on the ocean.
#35
I had the same problem of #30 and it has been solved using the 6.x-3.x-dev version as suggested by rooby at #31.
Thanx a lot!
#36
Thanks Rooby for your answer I will move to 6.x-3.x-dev version and it worked fine for me.