I just upgraded my site to Drupal 7, and adding new theme. The blocks on the theme are nodes from views. Unfortunately the blocks show different results for anonymous user and login one. I have checked the following:

- Turn off drupal all cache, even remove boost
- Turn off all views related cache (view cache and block cache)
- Check anonymous user has permission to view published node. In fact they can view the node if the url is supplied to them.
- Nodes all have published status

Both Views page and block result in the same number of nodes, but a number of recent nodes disappear completely in View result when anonymous browsing the page url or looking at block on the frontpage. The result is the site seems not updated for anonymous users.

The query in my view has nothing to do with user:

"SELECT node.created AS node_created, node.nid AS nid
FROM
{node} node
INNER JOIN {field_data_field_vocabulary_1} field_data_field_vocabulary_1 ON node.nid = field_data_field_vocabulary_1.entity_id AND (field_data_field_vocabulary_1.entity_type = 'node' AND field_data_field_vocabulary_1.deleted = '0')
WHERE (( (node.status = '1') AND (node.type IN ('news')) AND (field_data_field_vocabulary_1.field_vocabulary_1_tid IN ('1', '2', '18', '144')) ))
ORDER BY node_created DESC
LIMIT 25 OFFSET 0"

Anyone could shine some light in this issue would be much appreciated!

Thanks

CommentFileSizeAuthor
Capture1.PNG995.76 KBhuannc
Capture.PNG1.04 MBhuannc

Comments

arruk’s picture

I see that this has been here unanswered for a while, so I thought I would offer a suggestion. I would handle with a views template (probably rows), where you could check the value of a field, such as "private" and display the result based on that and the permission. Pseudocode: if (field_private==yes && !user_is_anonymous()) { show this row }

You probably already solved this yourself, but if not I hope this helps.

mustanggb’s picture

Priority: Major » Normal
renatog’s picture

Status: Active » Reviewed & tested by the community
Issue tags: +ciandt-contrib

In #1 exists a good suggestion by @arruk.

Works good and is a good way for doing it.

Thank you very much @arruk.

Regards.

renatog’s picture

Status: Reviewed & tested by the community » Fixed

@huannc, if need, you can follow this steps.

Any questions comment here okay?

Thank you very much.

Good Work.

Regards.

Status: Fixed » Closed (fixed)

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