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.
This is a request to add a hook to modify the tweet content before sending it to the theming layer. I'm thinking specifically of the twitter_pull_render function, adding something like this right after twitter_pull_retrieve:
module_invoke_all('twitter_pull_modify', $tweets);
That way I can add a hook in my custom module to modify the tweet appropriately.
Comments
Comment #1
rjbrown99 CreditAttribution: rjbrown99 commentedHere's a patch. I'm marking RTBC only because it's a one liner to add the hook.
Comment #2
jec006 CreditAttribution: jec006 commentedI'm leaving this issue open for d6, but I committed to d7. Thanks
http://drupal.org/commitlog/commit/12844/27daa46d5f229a7e00dc364f49c11cb...
Comment #3
thehong CreditAttribution: thehong commentedmodule_invoke_all() is used for collecting result, not to modify content. Please use drupal_alter instead.
Comment #4
thehong CreditAttribution: thehong commentedHere's patch.
Comment #5
thehong CreditAttribution: thehong commentedComment #6
thehong CreditAttribution: thehong commentedNo longer applicable.
Comment #7
thehong CreditAttribution: thehong commentedReroll.
Comment #8
thehong CreditAttribution: thehong commentedComment #9
thehong CreditAttribution: thehong commentedMy bad ;(
Comment #10
thehong CreditAttribution: thehong commentedMaintainer, can you review and apply my patch?
Comment #11
elliotttf CreditAttribution: elliotttf commentedThis looks good to me and is indeed the correct way to alter content that's passed by reference.
It might be worth it to include some of the other arguments that were passed to tiwtter_pull_render so that alter functions can have some context about which list of tweets they are altering, but that might belong in another ticket.
+1 on getting this committed as what's in there currently is not useful.
Comment #12
elliotttf CreditAttribution: elliotttf commentedOk, I immediately ran into a case where I needed the pieces that are used to retrieve tweets, so here's the patch re-rolled with that stuff added.
Comment #13
elliotttf CreditAttribution: elliotttf commentedWhoops, let's try that again with the correct arguments in the API example...
Comment #14
elliotttf CreditAttribution: elliotttf commentedWow, I'm not having a good day, here's the patch with no syntax errors...
Comment #15
bnash2501 CreditAttribution: bnash2501 commentedRerolled the patch from elliotttf to fix spacing and allow twitter_pull.api.php to be patched in.
Comment #16
Robert_W CreditAttribution: Robert_W commentedThis still isn't committed. I tried the latest patch in #15 and it still applies to the 2.0-alpha3. Can this be committed? This is a feature that needs to be implemented.