Events not hidden from non shoppers in 1.52
Web-enabled wishlist with reservations.
Brought to you by:
generalpf
In version 1.52, the events help states "When the event
occurs within 60 days, an event reminder will appear in
the display of everyone who shops for you."
I notice that events created are always visible to
everyone whether or not they are shopping for a certain
person or not.
Is it correct that events created by by one person
shouldn't be visible to others who are not shopping for
that person?
Logged In: NO
Yeah, it shouldn't show events for users you aren't shopping
for. This certainly can't be new -- I haven't gone near
that horrible query in months. I will look into it.
Logged In: YES
user_id=1044557
Originator: NO
I couldn't reproduce this. Can you?
Logged In: NO
The problem is the two left outer joins in the query that gets the said events (index.php). You select from the events table and do two left outer joins on users and shoppers. These left outer joins will always return all tuples from the events table, by the definition of a left outer join. Change the left outer join on shoppers to an inner join and you should get the desired behavior. Also you may re-think left outer joining with users, as this will return events attached to nonexistant users (but perhaps this is what you want.)
Logged In: NO
The suggestion in the comment below does not work.
Logged In: NO
I think this does though; same select clause, same from clause except throw away the join on shoppers and add this:
left outer join shoppers s on s.mayshopfor = e.userid
where s.shopper = CURRENT_UID or e.userid is null