I'm in the process of creating a site using the Garland_dropdown theme for drupal 6.3

I can't seem to see anonymous images. I've gone through every setting in drupal and nothing seems to work. Even when Logged in as the admin, the images are not there and have all permissions checked for the admin.

I've previously installed gravatar 6.x-1.3, and that wasn't working and the img src tag was getting filled with "/" and the alt tag was the only thing being displayed. So I upgraded to the dev version and now there is no img tag for anonymous users.

http://www.vtanman.com/index.php?q=node/910#comments

Am I missing a setting or something?

Thanks in advance...

CommentFileSizeAuthor
#1 gravatar.patch1.49 KBmrfelton

Comments

mrfelton’s picture

Component: Miscellaneous » Code
Category: support » bug
StatusFileSize
new1.49 KB

This is a bug.

I fixed it with the following:

Index: gravatar.admin.inc
===================================================================
--- gravatar.admin.inc	(revision 465)
+++ gravatar.admin.inc	(working copy)
@@ -119,8 +119,8 @@
   switch ($option) {
   // system default image
   case 1:
-  $image = variable_get('user_picture_default', '');
-  break;
+    $image = variable_get('user_picture_default', '');
+    break;
   // module default image
   case 2:
     $image = drupal_get_path('module', 'gravatar') . '/avatar.png';
Index: gravatar.module
===================================================================
--- gravatar.module	(revision 465)
+++ gravatar.module	(working copy)
@@ -93,8 +93,7 @@
       } else if (!empty($account->picture) && file_exists($account->picture)) {
         $picture = file_create_url($account->picture);
       }
-      else if (variable_get('user_picture_default', '')) {
-        $picture = variable_get('user_picture_default', '');
+      else if (variable_get('user_picture_default', '')) {        $picture = variable_get('user_picture_default', '');
       }
     
     // gravatar is not enabled : old behavior from user.module
@@ -218,7 +217,8 @@
     switch (variable_get('gravatar_imagedefault', 0)) {
       // drupal default picture
       case 1:
-        $path = variable_get('user_picture_default', '');
+        global $base_url;
+        $path = $base_url .'/'. variable_get('user_picture_default', '');
         $gravatar .= '?d='. urlencode($path);
         break;
       // gravatar module default picture

Not got enough time to look into it in more detail but this is enough to fix for me. Patch attached (this was made against the development snapshot from 2008-07-09)

dave reid’s picture

Status: Active » Closed (duplicate)

I've actually fixed this in #255375: [function.getimagesize]: URL file-access is disabled in the server configuration with $path = url($path, array('absolute' => TRUE')); which works a little more elegantly.