Closed (fixed)
Project:
OpenLayers Geocoder
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2010 at 22:30 UTC
Updated:
5 Aug 2012 at 22:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
ademarco commentedHi basvredeling, thanks for the patch but I'm afraid that's not the solution, in this context we need to get "openlayers data" tokens. Could you paste here the full error message?
Comment #2
basvredelingwhen adding or editing a new layer preset in the openlayers module /admin/build/openlayers/presets/add
Comment #3
redraven commentedJust confirming that I get the same error message.
Comment #4
ademarco commentedAfter upgrading OpenLayers module to its latest stable version (6.x-2.0-alpha8 at the moment of writing) and with the latest OpenLayers Geocoder CVS checkout the error disappears. Could you confirm that?
Comment #5
steinmb commentedOL 6.x-2.0-alpha8 and the latest Geocoder dev. release 1 August (I could not see any CVS commits after 29 of July so I figured that this was safe to use). This it the complete error message:
PHP Fatal error: Call to undefined function token_replace() in /Users/steinmb/htdocs/sites/drupal6/sites/all/modules/openlayers_geocoder/includes/behaviors/openlayers_geocoder_zoomtolocation.inc on line 48
BUT I have not enable the token module, this option should prob. in /admin/build/openlayers/presets/* be disable/ghosted and/or Geolocator should scream dependency error when you enable the module on missing token module?
Edit: No this I do not get. Why does the function render(&$map) get called after you save the form?
function options_form($defaults = array())
Comment #6
steinmb commentedFurther testing after #5 with the token module enabled.
(1)
Enable zoom to location but leaving the geocoder query field empty give me:
- No error message when saving the OL preset.
Should not the Geocoder query field be mandentory when zoom to location is enabled?
- Loading a map of on the node with the selected OL preset give this error message in the browser: Error during map rendering: TypeError: bounds.southwest is undefined
(2)
Entering an existing address in the geocoder query seem to give expected result as far as I can see.
(3)
Entering a non existing address into Geocoder query:
The WKT show the old/prev known value from test (2) but loading an map give me Error during map rendering: TypeError: bounds.southwest is undefined
Comment #7
Adam S commentedI'm getting this warning message too when I look at the Openlayers preset page. I also tested it with the basic installation. I have another development installation from one month ago and I don't have any of these problems in that site. What I mean is that it might be the upgrade from Drupal 6.17 to 6.19. I copied the working Openlayers modules and used them but in the new site I'm getting the warning.
I attached an image with the error.
Comment #8
basvredelingI tested on drupal 6.19, openlayers 2.0-alpha8, openlayers_geocoder 2.0-alpha4, token 1.14
problem persists, still the foreach error. Tokens are not properly passed to openlayers module.
So in reply to #4, no, I'm afraid I can't confirm this.
Comment #9
ademarco commented@basvredeling: thanks for testing this out. Could you test it using the latest Openlayers Geocoder dev snapshot and see if the problem still persists?
Comment #10
basvredelingtested the latest dev from 13 Aug 2010 14:16, problem remains the same.
Comment #11
hitfactory commentedCan also confirm that problem still exists on 6.x-2.x-dev as of Aug 14.
In my case the problem seems to be openlayers_views_openlayers_layers() is returning an empty $layers array. This is because I have no views using the openlayers display plugin.
Comment #12
ademarco commentedI've checked it with the latest cvs checkout of both modules and the problem seems not to be there anymore. Could somebody check and confirm that?
Comment #13
mathieu commentedTested today, with OpenLayers 6.x-2.0-alpha10, OpenLayers Geocoder 6.x-2.0-alpha5 and Token 6.x-1.14
I still get the message Warning: Invalid argument supplied for foreach() in (...)sites/all/modules/contrib/token/token.module on line 395
I changed the capitalization (see below) of the token source and it fixed the error.
Comment #14
Adam S commented#13 fixes the error, however, the tokens are not available.
Comment #15
weder commentedIs there any updates on this? I get the same error message, but I get an additional one from openlayers_geocoder.token.inc. This is with OpenLayers 6.x-2.0-alpha10, OpenLayers Geocoder 6.x-2.0-alpha5 and Token 6.x-1.15.
Comment #16
j2b commentedWould like to find out, if there are any movements in this issue. I'm sorry, that can not help on coding (lack of experience), but this is what I found out for now:
The modules installed:
All downloaded today (13.01.2011) from Drupla.org website. Enabling all mentioned modules, there is an error message:
Going through issue discussions, I stepped over this one: http://drupal.org/node/803210#comment-3069582, and modified token.module with a code in comment #7. This solution stated the following error content:
... which led me to this discussion, as I suspect errors comming from openlayers_geocoder's side. By manually disabling related modules one by one, I came upon fact, that geocoder_plus participates in this errors party. This disclosed the second warning concerning htmlspecialchars()..., but first one remained. After this I modified /openlayers_geocoder/includes/behaviours/openlayers_geocoder_zoomtolocation.inc file on line 36, by changing a Case from 'openlayers data' to 'Openlayers Data', and all errors dissapeared. (http://drupal.org/node/833086#comment-3495470)
After all and to my knowledge, here are 2 issues, and by such operations I could switch off errors, but still can not confirm (do not know how) the correctness of work of tokens. Openlayers Plus module for me seems not vital, as I wanted to check it, and it is not published on Drupal.org servers anyway. Hope this can help to move further in solutions.
Comment #17
muhleder commentedSeeing this as well, openlayers_geocoder reported as providing invalid tokens using snippet from here.
http://drupal.org/node/803210#comment-3069582
Comment #18
mattcasey commentedI was getting errors like #13 and 16 fixed it the same way, by fixing the case. Using Openlayers Geocoder 6.x-2.x-dev
Comment #19
muhleder commented#13 just stops the tokens from being evaluated as far as I can tell.
It just means that the code in openlayers_geocoder.token.inc at openlayers_geocoder_token_list() will never get evaluated as
$type will be 'OpenLayers Data'
is possibly where the problem is.
Comment #20
davide.brognoli commentedI tested on drupal 6.20, openlayers 2.0-alpha10, openlayers_geocoder 2.0-alpha5, token 1.15 and I get the same error:
warning: Invalid argument supplied for foreach() in C:\webroot\camozzi\app\trunk\website\sites\all\modules\openlayers_geocoder\includes\openlayers_geocoder.token.inc on line 24.
I try to "var_dump" the $features variable and I get this result
A var_dump of the $layer variable return me this result
Can this information help you to resolve the problem?
Comment #21
barrapontoI'm rerolling the first patch against dev, hope it works.
Comment #22
see15_aug commentedComment #23
see15_aug commentedHi, I am newbie and I can't understand how to use patches or where it use. I am facing same problem. I am using so please help.....
Comment #24
muhleder commentedToken support is currently broken, a side effect of that is these errors are being output. You could comment out the line referred to in the patch which will stop the warnings from appearing, but it looks like no-one has had the time or knowledge to fix them properly yet.
Remove this line to stop errors.
$form['query_tokens']['help']['#value'] = theme('token_help', 'openlayers data');Resetting issue statuses to correct values. Keeping status active as the issue seems to be confirmed.
Comment #25
steinmb commentedMust be fixed before we roll #1292378: [Meta] Release alpha 6. Added to release blocker list.
Comment #26
steinmb commentedOK let's try and get this rolling. First of we have this line that causes problems.
<?php $layers = module_invoke('openlayers_views', 'openlayers_layers'); ?>We try to invoke the submodule 'openlayers_views' but it might not be turned on and views might not exist on the system.
This patch make sure we do not try to invoke non enabled modules or/and assign the NULL result from as a token.
Comment #27
steinmb commentedNo reviewers, but I went ahead and committed http://drupalcode.org/project/openlayers_geocoder.git/commit/8a7b6d6 Have been unable to find any problem with the patch.
Comment #28
basvredelingThanks, patch looks ok