Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I'm loving tweetmeme and this module, which I've just installed on my site. However, I have organic groups that are used for posting private and public posts. It should not be possible to tweet about the private posts. Has anyone else solved this issue on their site already? Would be nice to have a feature to disable this, or for it to disable the tweetmeme counter (which of course displays a question mark for private posts) and tweet link on private posts.
Thanks,
Tobias
Comment | File | Size | Author |
---|---|---|---|
#4 | tweetmeme-unpublished-6.x.patch | 880 bytes | AlexisWilke |
#1 | fr.patch | 695 bytes | RobLoach |
Comments
Comment #1
RobLoachDefinitely important.
Comment #2
tobias CreditAttribution: 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 CreditAttribution: tobias commentedAnyone have any thoughts on this request?
Thanks,
Tobias
Comment #4
AlexisWilke CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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