I have a problem with part of a view not showing up for anonymous users. I believe this to be an Views issue, because the HTML isn't even being produced for Anonymous. So I have an ImageField that I've selected as one of my fields to display as a link. When a user is logged in, they can see the picture, and the HTML is there, but the HTML and the picture is not there for anonymous users.

Any help you can provide would be appreciated.

Drupal 6.9
Image 6.x-1.0-alpha4
ImageCache 6.x-2.0-beta5
ImageField 6.x-3.0-alpha4

$view = new view;
$view->name = 'Making_a_difference';
$view->description = 'making a difference';
$view->tag = 'making a difference';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Making a Difference', 'default');
$handler->override_option('fields', array(
  'field_headimage_fid' => array(
    'label' => '',
    'link_to_node' => 1,
    'label_type' => 'none',
    'format' => 'making_difference_default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_headimage_fid',
    'table' => 'node_data_field_headimage',
    'field' => 'field_headimage_fid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'Title',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'blog' => 'blog',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('title', 'Making a Difference');
$handler->override_option('items_per_page', 3);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', 'Making a Difference');
$handler->override_option('block_caching', -1);

Comments

primalmedia’s picture

I get the same problem with another view: The HTML for the image does not appear for anonymous users.

$view = new view;
$view->name = 'Photo_Link_Images';
$view->description = 'Photo Links under the left Nav';
$view->tag = 'Photo Links under the left Nav';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_photos_fid' => array(
    'label' => '',
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'image_nodelink',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_photos_fid',
    'table' => 'node_data_field_photos',
    'field' => 'field_photos_fid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'random' => array(
    'id' => 'random',
    'table' => 'views',
    'field' => 'random',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'title' => array(
    'operator' => '=',
    'value' => 'Photos',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'case' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('header', '<div class="sidephoto">');
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('footer', '<a href="/resources/photos" title="photos" class="ppp"><img src="/images/photos.gif" alt="photos" /></a></div>');
$handler->override_option('footer_format', '3');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 1);
$handler->override_option('distinct', 1);
$handler = $view->new_display('block', 'Photo Links', 'block_1');
$handler->override_option('block_description', 'Photo Links');
$handler->override_option('block_caching', -1);

primalmedia’s picture

I'd just like to add that ImageField and ImageCache and Views work correctly on every other part of the site, just not when ImageField is called as a Field.

drewish’s picture

are you using public or private file transfers?

drewish’s picture

Project: Views (for Drupal 7) » ImageField
Version: 6.x-2.2 » 6.x-3.x-dev
Component: Miscellaneous » Code
drewish’s picture

Project: ImageField » Views (for Drupal 7)
Version: 6.x-3.x-dev » 6.x-2.2
Component: Code » Miscellaneous

did you set the permissions on the default or just over ride it on the displays?

primalmedia’s picture

Hi Andrew,

I met you at Boston DrupalCon. Thank you for helping me out here.

I'm using public file transfers. I'm not sure what you mean about setting the permissions, or overriding it on the display.

primalmedia’s picture

I'm still looking for help with this if anyone has any insight or has experienced the same problem.

rezboom’s picture

Same problem here:
I have a view I would like to show to anonymous users:
The view is supposed to display 3 fields:
Logo, name of organisation, description of organisation

Only "name of organisation" is displayed, though.
Logo is an IMCE image
description is a text area (multiple rows)

"Access" (Permission) for this view is set to "unrestricted", both on default and on display "page"

Views is 6.x-2.x-dev from 2009-Feb-01

Grateful to anybody who can advise. Thanks!

primalmedia’s picture

Priority: Normal » Critical
merlinofchaos’s picture

Priority: Critical » Normal
Status: Active » Closed (won't fix)

There are no critical support requests.

Please note that CCK has its own field permissions system, so be sure to check that as well.

If the problem you're having is only with CCK fields, then you really should file your request against CCK since that's what the issue submission guidelines for the Views queue tell you to do. I really wish people would read that and do that, since I have no control over how fields from modules are rendered.

I'm going ot won't fix this; please file your issue in the appropriate place.

primalmedia’s picture

Priority: Normal » Critical
Status: Closed (won't fix) » Active

Merlin,

You are an egocentric arrogant asshole. If you can't be helpful, why don't you get out of the way.

This problem is Active. Why don't you attempt to simulate the problem as outlined above, and then reply with a helpful answer, or don't reply at all!

GFY!
Adam

drewish’s picture

Priority: Critical » Normal
Status: Active » Closed (won't fix)

adam, the only egocentric arrogant asshole in this queue is you. try contributing something other than bile for once.

michelle’s picture

@primalmedia: Wow, I am just completely stunned at your response. Earl has given so much to Drupal, far beyond what his job pays him for, I'm sure. He is an amazing asset to the community. And he is totally right. You need to file issues in the proper queue. A project's queue is the responsibility of its maintainer. He has every right to set something to won't fix if it is not something that he can or will fix. You need to respect his decision and learn how to behave in this community.

Michelle

merlinofchaos’s picture

I'm willing to accept the label of egocentric asshole, but at the same time you have to accept the label of fucking idiot. The solution to your problem is in your hands. I can see from the queries that are run and the view that is run exactly what is wrong, and you just plain refuse to believe me.

Now, let's see, who knows this software better?

Are you sure I am the egocentric asshole?

Oh and FYI, egocentric asshole that I am, I am shutting down this thread entirely, because it is just going to devolve into more namecalling.

merlinofchaos’s picture

I just reread the issue and realized I'm responding to the wrong one, slightly. First, my apologies, though my answer is actually roughly correct. However it's correct for a different reason.

First, from the issue submission guidelines:

If you only read one of these submission guidelines, read this one. (Then please read the rest) If your problem deals exclusively with fields or filters provided by another module (CCK, Image, VotingAPI are common) please post the issue under the queue for that module first; all modules are responsible for telling Views about their own fields. It's possible Views IS at fault, but the module maintainers are the best people to make that determination, and they can kick the issue into the Views queue with an explanation of what's wrong if that is the case.

I'm really sick of 1) people who refuse to read that, and more importantly, 2) people who read that and then assume that for some magical reason, *their* problem that only affects CCK fields must be a Views problem because of [insert bogus reason here].

You fall into the latter category, based on the opening paragraph of your sentence, which loops back into my previous response.

Buddharide’s picture

I'm having this problem too. The HTML for the view is not appearing for anonymous users.

rezboom’s picture

merlinofchaos - you rock and drupal would not be the same without you! we (the "end"users) are only able to build drupal sites because we stand on the shoulders of giants, like yours truly.

as merlin said, it is very likely that you did not set your permissions correctly - just look at the permissions table and make sure that anonymous users are allowed to view the fields you would like them to see.
worked perfectly for me.

Buddharide’s picture

Thanks, it does not appear to be a permissions thing. I've checked everything, and still cannot get the HTML to appear for Anon users. If it worked for you, could you tell us what versions of ImageField and Views are you using?

merlinofchaos’s picture

The one common thread here: So far everyone has reported the problem only happens for fields of type ImageField. Because modules are responsible for the output of their fields, you really need to take up this conversation in the imagefield queue.

superjuggler’s picture

try going to /admin/user/permissions. most likely there are no anony permissions checked for view field_xxxxx or something thereabouts. I'll stop now since this is probably the wrong place to continue this discussion.

drewish’s picture

odds are it's actually imagecache permissions that need to be set.

Buddharide’s picture

Permissions did not solve the problem, but upgrading Views to 6.2.3 did solve the problem. Don't know why the upgrade made any difference, but that's what solved it. Thanks for your suggestions.

stevethewebguy’s picture

I had this same problem. I was able to fix it by going into CCK and adding "anonymous user" to the "view" (not edit, of course) permissions for those fields.

admin/user/permissions

Hope this helps.

emdalton’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.2 » 6.x-2.4
Component: Miscellaneous » Content Permissions module
Category: support » bug
Status: Closed (won't fix) » Active

I had a similar problem and was able to fix it by going through the fields that appear within the view and setting all their permissions to allow anonymous users to view them (thanks to the hints above). This leads me to suspect that the problem is somewhere in Content Permissions (now part of CCK in Drupal 6.x, but formerly a separate module in 5.x). I am reopening this and assigning it to that project as a bug.

Note that some of my views worked just fine, and even though the view with the problem had images in it, just enabling anonymous users to view the images didn't resolve the problem. I enabled all the fields in that view, because I don't have time right now to fiddle around trying to figure out which one is causing the problem. However, if a CCK maintainer takes this bug on, I'll be happy to work with them to help determine where exactly the problem lies.

markus_petrux’s picture

Category: bug » support
Status: Active » Fixed

As soon as you enable the Content Permissions module, you should grant permissions explicitly, for all fields. Otherwise, no one is allowed to view any field, by default. That's how it works.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tvu007007’s picture

There's also another catch, make sure you set your file system to Public, otherwise the Views and Imagefields will output urls with the following:

Note: the "/default/" is used in the img src path when setting the filesytem to public.

ie.

http://localhost/system/files/logos/logo_infogroup_0.png?1278046065

where when set to public, anonymous users can access and the urls change to:

ie.

http://localhost/default/files/logos/logo_infogroup_0.png?1278046065

Download method:

Public - files are available using HTTP directly. ------- I have this set to on
Private - files are transferred by Drupal.