Currently, when a node revision is saved, even if the node is unpublished, and a twitter field is selected to send a tweet, the tweet is sent immediately. It would be a desired behavior to only send the tweet when the node revision is published.

The current schema for the field_data_field_post_to_twitter and field_revision_field_post_to_twitter (or whatever you call your field) does not include the actual tweet value (before token substitution), which prevents this feature from being possible. I think also adding a column here for "tweeted" or "tweet_sent" would also be required in order to store whether a tweet that was attached as a field to the node was actually processed. I would think that you would only want the tweet to go out once, although it would be possible to add an additional tweet if there was another revision that was added to the node, which could be scheduled to be published later.

CommentFileSizeAuthor
#3 twitter-n2461937-3.patch7.3 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

I'll work on this after getting 6.0 out the door.

DamienMcKenna’s picture

Also #2557783: The field name and hook_field_schema are out of sync seems to be related - the field doesn't seem to actually store any data.

DamienMcKenna’s picture

I guess I'm doing this now :)

This improves the form, removes twitter_post_field_attach_form entirely by moving the account selector into twitter_post_field_widget_form, and unchecks the status checkbox if the entity was previously published ($element['#element']->status).

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 94b951e on 7.x-6.x
    Issue #2461937 by DamienMcKenna: Field widget improvements, don't post...

Status: Fixed » Closed (fixed)

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