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

CommentFileSizeAuthor
#4 tweetmeme-unpublished-6.x.patch880 bytesAlexisWilke
#1 fr.patch695 bytesRobLoach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Priority: Normal » Critical
Status: Active » Needs review
FileSize
695 bytes

Definitely important.

tobias’s picture

Hi 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

tobias’s picture

Anyone have any thoughts on this request?

Thanks,

Tobias

AlexisWilke’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
880 bytes

Tobias,

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

AlexisWilke’s picture

Rob,

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

tobias’s picture

Hi 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

AlexisWilke’s picture

tobias,

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

RobLoach’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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