Download & Extend

'My' Saved Searches visible to anonymous users

Project:Views Saved Searches
Version:6.x-1.0-beta4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

This could a be a 'dumb' user issue but here goes:
I am using (amongst other things) - Drupal 6.20 and Views 6.x-2.12.
Authenticated users have permission to 'use VSS'.
Block was positioned in LHS space of page.

I had a pretty simple query with some exposed filters. I activated the view for VSS, set some filters, clicked apply, saved the search. 'magically' the block then appeared and there was a link to the saved view. Clicked on it - all worked fine.

The, went off to another browser (anonymous user). To my surprise the 'My Saved Searches' block appeared with the saved search of a site user.

I started going through the code. My travels took me to function views_savedsearches_load_multiple. In this function there is some logic that I read as: "if the user ID is less than or equal to zero or the view ID is less than or equal to zero then query the database for the saved search IDs, ignoring the user ID column" (i.e. retrieve all of them).

The line in question (about 450 in .module):
$result = db_query($query . $sort);

If I echo the result from this line (167) it tells me the value is '0' for anonymous users:
$uid = (arg(0) == 'user' && is_numeric(arg(1))) ? arg(1) : $user->uid;

Am I misunderstanding how the module works or perhaps line 450(ish) is/was a temporary addition during some testing?

Anyway, thought I would pass this on.

Regards and thank you for the module - it is great

Adam

Comments

#1

I have the same question.. Is it possible to show the link and then redirect anonymous users to login page.

Thanks

nobody click here