It looks to me like render_map.php is calling drupal_get_path() on lines 78 and 101 in spite of the fact that no such function is ever loaded. This will prevent the map from displaying correctly (or at all, for that matter).
(I'm running whatever version came from the SourceForge download. It's marked as 1.1-beta. That seemed to be the latest.)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | bawstats-716100-7.patch | 5.04 KB | egfrith |
| #3 | bawstats-drupal-get-path-716100-2.patch | 3.52 KB | juanjo_vlc |
Comments
Comment #1
egfrith commentedThanks for your report.
The official version of the drupal module code (with the bawstats code from sourceforge included) is now on the drupal website. I don't maintain the code that is on sourceforge, just the code on the drupal website. I do try to keep it in sync with the bawstats code.
render_map.php should work when the code is used as a drupal module, as drupal_get_path() is a core function:
http://api.drupal.org/api/function/drupal_get_path/6
Could you check that this is a problem with the most recent version of the 6.x code downloaded from the drupal website please?
Comment #2
juanjo_vlc commentedI can confirm it's happening on 6.x-1.1 (downloaded using drush)
Comment #3
juanjo_vlc commentedI noticed you skip the bootstraping on the file map_render.inc.php, so drupal calls doesn't work.
I made some little changes to include map rendering as a drupal callback, so it's not necessary to bootstrap again, and change the generation of images to the icons directory inside the module folder. This works for the map generation, if you use any other calls to drupal functions you must do the same or include bootstraping.
Here is my patch.
Comment #4
egfrith commentedThanks very much for this juanjo_dv. I will try to look at the patch soon.
Comment #5
rezboom commentedpatch in #3 works for me! thanks!
Comment #6
egfrith commentedI've had a look at the patch now. There seem to be a number of bits to it, and I can only see that the last bit is relevant to the bug, which I still can't replicate.
I think the best solution is to try to implement the map as a drupal callback menu. I will try to look at this soon.
I have however committed the part of the patch that deals with the path the empty.png icon. See http://drupalcode.org/project/bawstats.git/commit/2486319
Comment #7
egfrith commentedThe attached patch creates a callback to call bawstats_render_map_image(). This function is a drupalised version of the previous baw_render_map_image(). I have factored out the code that actually creates the image (as oppose to deliver it) bawstats_create_map_image().
I have committed this patch. Hopefully this fixes the problem - please let me know if not.