Download & Extend

"Announce This Post On Twitter" check box does not respect Preview

Project:Twitter
Version:6.x-2.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

Apologies that I don't have time to dig into the code at the moment.

Steps to repeat problem:
1. On a blog post, turn off the "announce this post on twitter" check box
2. Click preview
3. On the preview page "announce this post on twitter" is now back on.

If the user doesn't notice that this got turned on again they could easily end up having their post announced via twitter when that was clearly not their intention.

Comments

#1

Version:6.x-2.5» 6.x-2.6

Verified in 2.6.

#2

Another issue for Preview: #633450: Status reset at node preview. Checkbox is not fixed though.

#3

Status:active» needs review

I fixed 'twitter post' checkbox to save its state through node previews. The patch is attached.

AttachmentSize
twitter.module.node_preview_checkbox.graker.patch 551 bytes

#4

The patch does fix the problem on my system

#5

Status:needs review» needs work

Probably fixes the issue, but I've never seen values in forms handled like that for preview (though it is 3:32 AM so my memory isn't as chirpy as that annoying bird outside is), so I suspect something else is at fault, perhaps the javascript?

Also, if the 3.x branch has this also, the code in question has been moved into a separate module (twitter_post)

#6

Hmm. Maybe I didn't understand you right, but actually it is a common way to handle #default_value in forms.

#7

Aah... Looked around trying to find examples of that, but found this a pathauto one instead, http://drupal.org/files/issues/262464_pathauto_node_preview_11.patch . Instead of using form_values, they use that one in $node, so with that in mind re-patched. Same effect, but looking in $node seems more common.

AttachmentSize
524370_twitter_preview_alt.patch 1.42 KB

#8

oops copy and paste.

AttachmentSize
524370_twitter_preview_alt.patch 1.41 KB

#9

Yeah, it's nearly the same thing. I just more used to use $form_state since this way I can handle default values for all forms, not only node edit ones.

#10

Not sure why, but when I made the changes in #8, I started getting the message "Successfully posted to Twitter" when new accounts were created. I instead used the patch in #3, and it seems to be working fine

#11

guessing ya using content_profile phreestili?

Ignore my patch in #8, shouldn't be done in prepare I realized soon after, should be done in form_alter; I think it'd be best to use a combination of a patch, where it checks if isset $node->twitter in the form_alter, as it's shorter, but shrug.

#12

Yep, I am using content profile

#13

neither patch #3 nor #8 do apply cleanly to 6.x-3.0-beta3

#14

Status:needs work» closed (duplicate)

Duplicate of #633450: Status reset at node preview

nobody click here