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.
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)
Comment | File | Size | Author |
---|---|---|---|
#14 | location.admin_.inc-make-compat-5.3.patch | 1.13 KB | hutch |
Comments
Comment #1
spacereactor CreditAttribution: spacereactor commentedanother 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.
Comment #2
spacereactor CreditAttribution: spacereactor commentedanyone 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
Comment #3
hutch CreditAttribution: hutch commentedI 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
Comment #4
spacereactor CreditAttribution: spacereactor commentedthank, i remove the two "&" and error message doesn't appear anymore. Can the location Maintainer team confirm and add it to the dev.
Comment #5
kk_alscg CreditAttribution: kk_alscg commentedHello,
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..
Comment #6
spacereactor CreditAttribution: spacereactor commentedi 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.
Comment #7
YesCT CreditAttribution: YesCT commentedSometime &$ 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.
Comment #8
hutch CreditAttribution: hutch commentedMy (somewhat tenuous) understanding of this is that the &$ should be present in the function definition but not in the call.
so
and
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
Comment #9
YesCT CreditAttribution: YesCT commentedYes, I think that is how I have seen it work in my recent looks into APIs....
Comment #10
Reg CreditAttribution: Reg commentedI 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.
Comment #11
astro87 CreditAttribution: astro87 commentedMy 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
Comment #12
sistro CreditAttribution: sistro commentedThe #3 works also form me!
I had also theme problems, solved with this workaround, thanks a lot!
Comment #13
YesCT CreditAttribution: YesCT commentedPlease (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]
Comment #14
hutch CreditAttribution: hutch commentedHere 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.
Comment #15
YesCT CreditAttribution: YesCT commentedComment #16
lobolo-1 CreditAttribution: lobolo-1 commentedHi...
#3 worked out for me...was haunted by the same warning message...
thanks...
Comment #17
hip CreditAttribution: hip commented#3 did it for me too.
Comment #18
YesCT CreditAttribution: YesCT commentedlobolo 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. :)
Comment #19
hip CreditAttribution: hip commentedI actually applied the patch and it did the trick.
+1 to become a proper fix ;-)
Comment #20
pog21 CreditAttribution: pog21 commentedPatch in #14 worked for me.
Comment #21
kriskhaira CreditAttribution: kriskhaira commented#14 works for me.
Comment #22
tangent CreditAttribution: tangent commentedThe solution is good. Let's commit this please.
Comment #23
bigpepper CreditAttribution: bigpepper commentedPerfecto. This patch worked great for me. Well done.
Comment #24
nilu5233 CreditAttribution: nilu5233 commentedwhen 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
Comment #25
hutch CreditAttribution: hutch commentedin location.admin.inc, line 292: function theme_location_map_link_options(&$form)
try removing the '&'
Comment #26
nilu5233 CreditAttribution: nilu5233 commentedthank you to reply my question
but i remove the "&", the warning is still on the page
so, what i can do it!?
Comment #27
rooby CreditAttribution: rooby commentedThere 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
Comment #28
rooby CreditAttribution: rooby commentedMarked #685792: warning: Parameter 1 to theme_location_map_link_options() expected to be a reference as dupliucate of this issue.
Comment #30
Avalanche CreditAttribution: Avalanche commentedI 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:
Comment #31
rooby CreditAttribution: rooby commented@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.
Comment #32
Avalanche CreditAttribution: Avalanche commentedGot it -- thanks Rooby!
Comment #33
Marcus 78 CreditAttribution: Marcus 78 commentedStill 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?
Comment #34
Fidelix CreditAttribution: Fidelix commentedMarcus 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.
Comment #35
lucabarbetti CreditAttribution: lucabarbetti commentedI 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!
Comment #36
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks Rooby for your answer I will move to 6.x-3.x-dev version and it worked fine for me.