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.
Current version doesn't include retweets by default, and there's no documentation as to how to turn them on/off.
Comment | File | Size | Author |
---|---|---|---|
#3 | twitter_pull-retweets_param-2099547-3.patch | 2.52 KB | jeffschuler |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThere's an enable retweets option. Is that only in the latest dev maybe?
Comment #2
jesss CreditAttribution: jesss commentedThe retweets are missing from the block data, but are still counted in the total number of tweets. So, if you set your block to display the three latest tweets, but one of them is a retweet, the block will only display two tweets.
It looks like the $rts parameter isn't being passed to twitter_pull_render() within twitter_pull_block_view().
The comments say that the $rts parameter defaults to TRUE, but the default for twitter_pull_render() and twitter_pull_retrieve() is NULL, so I believe that's incorrect.
I manually passed TRUE through twitter_pull_render() and then retweets displayed in my block.
The less hacky solution would be to:
Comment #3
jeffschulerHere's a shot at fixing this. It:
$rts
to TRUE, like the function docs say,twitter_pull_render()
(to matchtwitter_pull_retrieve()
)rts
andexclude_replies
as configurable block data.It's working for my the block that my custom module creates. I'm not sure if this is working for the default blocks or other methods that Twitter Pull allows.
My custom module now implements
twitter_pull_blocks()
like this:Comment #4
jesss CreditAttribution: jesss commentedI couldn't get the patch to apply with git (though that's probably my fault -- I'm a git novice), but I applied it manually and retweets are now showing as expected.
Retweets are still included in the count of the tweets returned, even if they're not included in the call, but that's the behavior of the API, not the module. Explaining that in the documentation might be nice.
https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline
Comment #5
jesss CreditAttribution: jesss commentedComment #6
joachim CreditAttribution: joachim commentedWhat's the reason for changing the defaults here?
Comment #7
jeffschulerThe function docs in
twitter_pull_retrieve()
state that the default value for$rts
isTRUE
. The patch makes this so for bothtwitter_pull_retrieve
andtwitter_pull_render
.Comment #8
Pepper CreditAttribution: Pepper commentedThis seems to still be a problem in the Nov 5, 2015 - 7.x-2.0-alpha3. But the patch worked for that version as well.
Comment #9
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedThe patch is working well and should be comitted, as the current implementation makes the twitter_pull blocks really inflexible to configure.