Hello. I have got this strict error on Location Map:

Strict warning: Only variables should be passed by reference in locationmap_page() (line 240 of C:\xampp\htdocs\drupal\sites\all\modules\locationmap\locationmap.module).

The module works apparently correctly, but this warning persists.
Do you have any suggestions? Thanks in advance for your help.

CommentFileSizeAuthor
#3 StrictWarningmsg.png96 KBAAgrios
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wayne2011’s picture

I've got the identical problem.

Caffeine Addict’s picture

I installed this module last night and haven't managed to get this error. Could you post steps to replicate, I could look at it...

AAgrios’s picture

FileSize
96 KB

I also received the same message using location map. All seems to work fine.. except this error appears on my location page. Tried using another API key just to troubleshoot, but no luck. Ideas?
"
Strict warning: Only variables should be passed by reference in locationmap_page() (line 240 of /Users/agriosa/Sites/acquia-drupal/sites/all/modules/locationmap/locationmap.module). "

wayne2011’s picture

Caffeine Addict, basically, I just installed and configured then went to the default path and got the error page. Still do whenever I visit the page while being logged in but it seems to work without issues.

Caffeine Addict’s picture

Can you list the settings you are using excluding the API key?

I've been changing all the settings on a staging site using this module and i can't replicate... If you can list all the settings i'll try using the exact same ones to replicate the issue.

Caffeine Addict’s picture

Oh hang on, you are using php error reporting on the strict setting! Ok i'll be able to replicate that now...

Caffeine Addict’s picture

Line erroring:

if (user_access('administer locationmap')) {
// TODO: Remove drupal_render and update to D7 desired behaviour. See http://drupal.org/update/modules/6/7#unrendered
$output .= drupal_render(drupal_get_form('locationmap_in_place_edit_form'));
}

Looks like its to do with arrays / variables / strings :

http://stackoverflow.com/questions/2354609/strict-standards-only-variabl...

I personally wouldn't run a production enviroment on strict error reporting... (though in a perfect world that shouldn't be an issue ;-) )

rupertj’s picture

The error's triggered by passing the output from drupal_get_form straight into drupal_render. If you assign it to a var first, the error goes away.

rupertj’s picture

Status: Active » Closed (fixed)

I've fixed this and released a 1.2 release with the fix in.

  • Commit fc36805 on master, 7.x-2.x, 8.x-2.x by rupertj:
    Issue #1328402 by rupertj, Caffeine Addict: Fixed strict warning on map...