Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect Tweet this post checkbox behavior in the classic editor. #169

Merged
merged 1 commit into from
Jun 3, 2022

Conversation

iamdharmesh
Copy link
Member

@iamdharmesh iamdharmesh commented Jun 2, 2022

Description of the Change

As described in #168, Currently, whenever we Save draft post with the Tweet this post checkbox checked, it always tweets post when we publish a post, even when we publish a post with the Tweet this post checkbox unchecked.

This is happening because when the checkbox is unchecked, it won't send with $_POST data and the plugin uses the existing value of the meta field (check here). Which is enabled. So, the tweet is always get posted.

This PR contains changes to handle the unchecked "Tweet this post" checkbox for the classic editor and fix the reported issue.

Closes #168

Alternate Designs

Possible Drawbacks

Verification Process

  1. Install the Classic Editor plugin.
  2. Create a draft post in the classic editor (make sure the Tweet this post checkbox is checked).
  3. Try to uncheck the checkbox and Save draft.
  4. Verify checkbox is unchecked.
  5. Check the checkbox and Save draft.
  6. Uncheck the checkbox and Publish post.
  7. Make sure the post is not tweeted.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Fixed - Incorrect Tweet this post checkbox behavior in the classic editor.

Credits

Props @iamdharmesh

@iamdharmesh iamdharmesh self-assigned this Jun 2, 2022
@iamdharmesh iamdharmesh added this to the 1.2.0 milestone Jun 2, 2022
@iamdharmesh iamdharmesh requested review from a team and cadic and removed request for a team June 2, 2022 07:32
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@iamdharmesh not as part of the current PR, do you think it worth to add new test (unit or e2e) to cover this situation?

@iamdharmesh
Copy link
Member Author

Yes, @cadic I have added this situation to e2e tests in PR #167, and during the debug on test failing I found this issue. :)

@iamdharmesh iamdharmesh merged commit fdf1cfe into develop Jun 3, 2022
@iamdharmesh iamdharmesh deleted the fix/168 branch June 3, 2022 08:49
@iamdharmesh iamdharmesh modified the milestones: 1.2.0, 1.1.2 Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish after save draft with tweet enabled in Classic Editor always tweet post.
2 participants