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.


mandclu’s picture

Category:support» feature

I 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.

mdowsett’s picture

for 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...

pglatz’s picture

Same 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).

eaton’s picture

If you set the text of the default tweet message to empty, it should default to *not* posting...

Leeteq’s picture

Agree with #2 - should be an admin setting.

Leeteq’s picture

Version:6.x-2.0» 6.x-2.x-dev
Miria’s picture

Also "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. . .

moritzz’s picture

I agree: Would be very handy to have an option on the content type configuration settings.

dbeall’s picture

I 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

pheraph’s picture

Just 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.

doubledoh’s picture

I 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...

catch’s picture

Status:Active» Needs review
new1.7 KB

Here's a patch.

dbeall’s picture

hey, The check box works,
but the module is still broke if you have a twitter name with an underscore_

catch’s picture

Twitter 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.

dbeall’s picture

sorry, was just a comment..
The checkbox works nice, thanks for the patch

steinmb’s picture

Status:Needs review» Closed (fixed)
NicolasH’s picture

Version:6.x-2.x-dev» 7.x-3.0-beta4
Status:Closed (fixed)» Active

Looks like this never made it into the D7 version.

yashadev’s picture

Status:Active» Needs review
new1.46 KB

Patch for 7.x core based on the #12th comment. Please review

danielstrum’s picture

Version:7.x-3.0-beta4» 7.x-4.1

I 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?

juampynr’s picture

Version:7.x-4.1» 7.x-4.x-dev
Status:Needs review» Needs work

Patch needs to be re-rolled against 7.x-4.x.

juampynr’s picture

Version:7.x-4.x-dev» 7.x-5.0

And now against 7.x-5.0.

plopesc’s picture

Status:Needs work» Needs review
new2.44 KB

Attaching 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.


juampynr’s picture

Version:7.x-5.0» 7.x-5.x-dev
Status:Needs review» Fixed

Committed 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().


Status:Fixed» Closed (fixed)

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