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 was just wondering how I can alter the module so that the checkbox to post to twitter is on by default?
Thanks for any help.
Comment | File | Size | Author |
---|---|---|---|
#22 | default_option-397192-22.patch | 2.44 KB | plopesc |
#18 | checkbox-on-twitter-397192-18.patch | 1.46 KB | yashadev |
#12 | 397192.patch | 1.7 KB | catch |
Comments
Comment #1
mandclu CreditAttribution: mandclu commentedI don't think this currently exists, but it would be great if it did. Personally, I'd like to be able to set this per content type.
Comment #2
mdowsett CreditAttribution: mdowsett commentedfor me, it is ON by default....I'd rather have it OFF by default.
It'd be nice to have it as an admin setting...
Comment #3
pglatz CreditAttribution: pglatz commentedSame here - and I often tweet something prematurely because I forget this is the default. Perhaps this behavior could be an option (set to on or off by default).
Comment #4
eaton CreditAttribution: eaton commentedIf you set the text of the default tweet message to empty, it should default to *not* posting...
Comment #5
Leeteq CreditAttribution: Leeteq commentedAgree with #2 - should be an admin setting.
Comment #6
Leeteq CreditAttribution: Leeteq commentedComment #7
Miria CreditAttribution: Miria commentedAlso "on" by default for me when I don't need EVERY instance of that content type posted to Twitter. An "off" default would work way better for me, but I can see how an "on" default would be preferable to others. This really needs to be an admin setting. . .
Comment #8
moritzz CreditAttribution: moritzz commentedI agree: Would be very handy to have an option on the content type configuration settings.
Comment #9
dbeall CreditAttribution: dbeall commentedI have tried all kinds of things here, but it just throws an error page of one type or another.. haven't got php figured out yet, sorry.
any help to make the checkbox always 'on'. When I remove 'empty' nothing changes..
$form['twitter']['post'] = array(
'#type' => 'checkbox',
'#title' => t('Announce this post on Twitter'),
'#default_value' => (empty($form['nid']['#value'])),
'#id' => 'twitter-toggle',
);
thanx, dave
Comment #10
pheraph CreditAttribution: pheraph commentedJust change the line
'#default_value' => (empty($form['nid']['#value'])),
for unchecked by default into
'#default_value' => '0',
and for checked into
'#default_value' => '1',
This should be selectable in the admin interface, but until that it works for me that way.
Comment #11
Doomd CreditAttribution: Doomd commentedI just want to add that having this be a selectable option in admin is VERY desired I think. I've had 3 clients request it now (because they DON'T want it to publish to twitter by default). I've accidentally published alot of rubish posts to twitter too...
Anyway, thanks for the hack fix for now...
Comment #12
catchHere's a patch.
Comment #13
dbeall CreditAttribution: dbeall commentedhey, The check box works,
but the module is still broke if you have a twitter name with an underscore_
Comment #14
catchTwitter names with underscores have nothing to do with this issue, you'll need to find another issue in this queue, or create one, if you want to report that bug or discuss it.
Comment #15
dbeall CreditAttribution: dbeall commentedsorry, was just a comment..
The checkbox works nice, thanks for the patch
Comment #16
steinmb CreditAttribution: steinmb commentedComment #17
NicolasH CreditAttribution: NicolasH commentedLooks like this never made it into the D7 version.
Comment #18
yashadev CreditAttribution: yashadev commentedPatch for 7.x core based on the #12th comment. Please review
Comment #19
danielstrum CreditAttribution: danielstrum commentedI just tried this patch (#18) on 7.x-4.1. The patch seemed to apply cleanly but now, when I go to the configuration page for Twitter Post, I just get a white screen. Yashadev, thanks for you work on this... might you take a look and see if the patch needs a tweak to work with 7.x-4.1?
Comment #20
juampynr CreditAttribution: juampynr commentedPatch needs to be re-rolled against 7.x-4.x.
Comment #21
juampynr CreditAttribution: juampynr commentedAnd now against 7.x-5.0.
Comment #22
plopescAttaching patch against 7.x-5.x branch.
Instead of creating a new radio for each content type, the module works with a single radio for all content types. If you consider that the previous approach is better, we should change the config page architecture to avoid possible misunderstandings.
BTW, I changed the default values for
twitter_post_types
variable, referred to D6 default content type names.Regards.
Comment #23
juampynr CreditAttribution: juampynr commentedCommitted with a few changes:
* Changed the radio button for a chexbox.
* Added descriptions.
* Made defaults so the user has to decide which content types support posting.
* Added twitter_post_uninstall().
Thanks!