Closed (fixed)
Project:
TweetMeme
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2010 at 08:59 UTC
Updated:
3 Apr 2011 at 18:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
robloachDefinitely important.
Comment #2
tobias commentedHi Rob Loach,
Thanks for this patch - I looked at it and I think it only addresses the issue of hiding tweetmeme from unpublished nodes. This is helpful, but what I am looking for is a patch to hide it from posts that are not available to anonymous users. I use organic groups and much of our content requires a login.
Cheers,
Tobias
Comment #3
tobias commentedAnyone have any thoughts on this request?
Thanks,
Tobias
Comment #4
AlexisWilke commentedTobias,
I have the same problem... but for another module. I'd be delighted to find a good solution to check whether a page can be viewed by a given user (be it user 0.)
As Rob pointed out, unpublished posts are definitively not accessible by anonymous users and should not be shown.
I propose the following patch that also moves the test of the build mode in the first if() so we can avoid the variable_get() and in_array() calls as testing the node is required and would happen anyway, but the $node variable is available and require no calls.
Thank you.
Alexis
Comment #5
AlexisWilke commentedRob,
As a side note... you sample image on your project page shows a question mark... 8-)
Maybe you should show something like 1,000,000 tweets instead!
Thank you.
Alexis
Comment #6
tobias commentedHi AlexisWilke -
Thanks for looking into this issue. I have tried your patch but nothing seems to change. What I want to hide is the tweetmeme icon altogether on private posts - are we on the same page?
cheers,
tobias
Comment #7
AlexisWilke commentedtobias,
My patch is similar to Rob's with an extra optimization.
It's very easy to know whether a post is published or not. It's much harder to know whether it is private. Actually, there isn't a good interface to test whether a post is private. The fact is that Drupal is not written correctly for that. For most of the access tests, it uses global $user and not the user you would want to pass in. That comes from the menu & node implementations that suck in that regard.
I thought I've seen some modules achieving such a feat and wanted to rip-off their code, but the only one I've found so far has obvious bugs and thus is not good...
Thank you.
Alexis Wilke
Comment #8
robloachhttp://drupalcode.org/project/tweetmeme.git/commit/b0c828c
http://drupalcode.org/project/tweetmeme.git/commit/07deb34