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

Copying the content of a scheduled (future) post doesn't work #296

Closed
davilera opened this Issue Nov 2, 2017 · 3 comments

Comments

4 participants
@davilera

davilera commented Nov 2, 2017

Version Information

  • PHP: 7
  • WordPress: 4.8.3

NOTE: this issue might be related to #295.

Steps to Reproduce

  1. Create a new post in one language
  2. Set a future date
  3. Schedule the post
  4. Look for the Translation meta box
  5. Click on Copy source post (and maybe enable the checkbox for copying the feat. image)
  6. Click on Change relationship
  7. Select Create new post
  8. Click on Save and reload this page

What I Expected

The translated post should have the same title, slug, post content, excerpt (and possibly featured image) as the original post.

What Happened Instead

Only the title and slug were copied. Post content, excerpt, and featured images remain empty.

If I apply the "solution" described in #295 (that is, re-copying the post and saving it using the Update button in the Publish meta box) doesn't work.

@davilera

This comment has been minimized.

Show comment
Hide comment
@davilera

davilera Nov 2, 2017

I looked at the source code and there are a couple of checks that might explain this behavior.

In inc/post-translator/Mlp_Translatable_Post_Data.php line 506, there's a function that checks if is_connectable_status. The if condition doesn't include the future status.

In inc/post-translator/Mlp_Save_Post_Request_Validator.php line 65, there's a function that checks if a post is_real_revision. One of the if conditions is also missing the future status.

I think that adding said status in those if statements fixes the issue, but I'm not 100% sure (nor do I know if other parts of the code should be addressed).

davilera commented Nov 2, 2017

I looked at the source code and there are a couple of checks that might explain this behavior.

In inc/post-translator/Mlp_Translatable_Post_Data.php line 506, there's a function that checks if is_connectable_status. The if condition doesn't include the future status.

In inc/post-translator/Mlp_Save_Post_Request_Validator.php line 65, there's a function that checks if a post is_real_revision. One of the if conditions is also missing the future status.

I think that adding said status in those if statements fixes the issue, but I'm not 100% sure (nor do I know if other parts of the code should be addressed).

@tfrommen tfrommen added this to the v2.11.0 milestone Nov 3, 2017

@tfrommen tfrommen self-assigned this Nov 3, 2017

@tfrommen

This comment has been minimized.

Show comment
Hide comment
@tfrommen

tfrommen Nov 3, 2017

Contributor

Hi again,

leaving aside all the things related to how Create new post works, you re right that scheduled posts cannot be translated right now.

We already fixed this for the new major version of MultilingualPress, but now I also included this to be released in the next minor update.
If you need this now, you can add the 'future' post status yourself, in the is_connectable_status() method. The request validator code is OK, althought I simplified it a little bit. Nothing to do for you, though.

Thanks for reporting this,
Thorsten

Contributor

tfrommen commented Nov 3, 2017

Hi again,

leaving aside all the things related to how Create new post works, you re right that scheduled posts cannot be translated right now.

We already fixed this for the new major version of MultilingualPress, but now I also included this to be released in the next minor update.
If you need this now, you can add the 'future' post status yourself, in the is_connectable_status() method. The request validator code is OK, althought I simplified it a little bit. Nothing to do for you, though.

Thanks for reporting this,
Thorsten

@gmazzap gmazzap assigned seville76 and unassigned tfrommen May 29, 2018

@Dinamiko

This comment has been minimized.

Show comment
Hide comment
@Dinamiko

Dinamiko Aug 27, 2018

Contributor

This is already merged into master.

Contributor

Dinamiko commented Aug 27, 2018

This is already merged into master.

@Dinamiko Dinamiko closed this Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment