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

Copy a post: Content not copied when using Block editor and default post format set in Settings > Writing #11256

Closed
brbrr opened this issue Feb 4, 2019 · 12 comments

Comments

@brbrr
Copy link
Member

commented Feb 4, 2019

Steps to reproduce the issue

  1. Make sure your theme supports post types (such as Twenty Seventeen)
  2. Under Settings > Writing, set a default post format other than "Standard"
  3. Go to wp-admin/post-new.php
  4. Set 'Gallery' or 'Image' post format
  5. Add a paragraph and gallery blocks as a content
  6. Publish and try to copy the post.
  7. Post copied without content

What I expected

post content is copied no matter what post format I used

What happened instead

See reproduction steps

screencast 2019-02-04 16-09-44

@jeherve jeherve changed the title Copy a post: Content not copied for non-standard post types is some cases Copy a post: Content not copied for non-standard post formats is some cases Feb 4, 2019

@jeherve jeherve changed the title Copy a post: Content not copied for non-standard post formats is some cases Copy a post: Content not copied when using Block editor and default post format set in Settings > Writing Feb 4, 2019

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 4, 2019

I believe this is caused by the default content added by the Block editor when you've set a default post format for your site; it overwrites the content that is brought over by Jetpack.

This was implemented here:
WordPress/gutenberg#4554

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 4, 2019

@kwight Maybe we should handle content a bit differently when in the block editor, and load the original post's content into the editor later?

@jeherve jeherve added the [Pri] Low label Feb 4, 2019

@brbrr

This comment has been minimized.

Copy link
Member Author

commented Feb 4, 2019

jeherve changed the title Copy a post: Content not copied for non-standard post formats is some cases Copy a post: Content not copied when using Block editor and default post format set in Settings > Writing

FWIW - it also reproducible when post type was set manually on the original post.

@kwight

This comment has been minimized.

Copy link
Member

commented Feb 4, 2019

Hm, I'll look into this today. Very intentionally, I've kept things so that all work is done before we even know what editor is being used – so that the editor should never be a factor. Maybe I've just missed some proper post format handling.

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 4, 2019

It seems the block editor and its reusable blocks get a bit in the way, because they add some default content to the editor after the editor is initiated.

@chuckreynolds

This comment has been minimized.

Copy link

commented Feb 6, 2019

FWIW it doesn't seem to work with ACF either. still on 4.9.9 w/ latest ACF & JSON sync but nothing copies over at all. Not sure if piggy back onto this issue or a new one more specific to ACF should be created?

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

@chuckreynolds That is to be expected. Jetpack's Copy Post feature does not copy post meta, so data from ACF will be copied from one post to the next.

@kwight

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

@chuckreynolds Note that the hooks do exist for any plugin to add their own support 👍

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

Note that the hooks do exist for any plugin to add their own support

👍 I should have mentioned that, my bad. For reference, the hooks are available here:
https://developer.jetpack.com/module/copy-post/

And here is the module itself:
https://github.com/Automattic/jetpack/blob/7.0/modules/copy-post.php

@chuckreynolds

This comment has been minimized.

Copy link

commented Feb 7, 2019

@chuckreynolds Note that the hooks do exist for any plugin to add their own support 👍

roger roger! I would assume however that Jetpack would take post meta as part of the "copy"... But I'll hit up the ACF crew to add those hooks. Cheers.

@jeherve

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

I would assume however that Jetpack would take post meta as part of the "copy"

That's a good point. That's something we've opted not to do, as it can sometimes have some unintended consequences, when post meta is used to store data that has to remain unique to a post. An example can be WooCommerce product meta data, or Jetpack Publicize information (whether a post has been publicized or not). Depending on the feedback we get in the next few weeks / months about this new feature, we may reconsider and consider switching to some kind of post meta blacklist of things that should not be copied for example.

@chuckreynolds

This comment has been minimized.

Copy link

commented Feb 8, 2019

we may reconsider and consider switching to some kind of post meta blacklist of things that should not be copied for example.

Cool - I can understand it to not be high on the triage list at this point but I think that's definitely something to explore moving forward. Thanks for listening. Cheers!

@jeherve jeherve added this to the 7.1 milestone Feb 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.