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

getEditedPostAttribute("content") doesn't return edited content of published posts #5073

Closed
2 tasks
IreneStr opened this issue Feb 15, 2018 · 4 comments
Closed
2 tasks
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended

Comments

@IreneStr
Copy link
Member

Issue Overview

getEditedPostAttribute("content") doesn't return the most up-to-date version of the content when called on a published post.

Steps to Reproduce

  1. Open a published post (or write a new post and hit 'publish')
  2. Make some changes in the content. Do not hit 'update'
  3. Call wp.data.select("core/editor").getEditedPostAttribute("content") in your console.
  4. See that the latest changes are not reflected in the returned content.

Expected Behavior

getEditedPostAttribute("content") should return the most up-to-date version of the content.

Current Behavior

When I edit a published post and call wp.data.select("core/editor").getEditedPostAttribute("content") in the console, the returned content is not the latest version. When I hit update, and try again, I do get the most recent version.

NB: when I do the same on a draft, I do get the most recent version either way.

Gutenberg version

Latest master

Todos

  • Tests
  • Documentation
@atimmer atimmer added the [Type] Bug An existing feature does not function as intended label Feb 15, 2018
@aduth
Copy link
Member

aduth commented Feb 15, 2018

What version or commit are you running? I could imagine prior to #4955 & #5071 the content attributes specifically could fall behind in updates.

Running master and your steps to reproduce, I am receiving the expected content in the console.

@aduth aduth added the [Status] Needs More Info Follow-up required in order to be actionable. label Feb 15, 2018
@mtias
Copy link
Member

mtias commented Mar 6, 2018

Closing but feel free to reopen if there is more info.

@mtias mtias closed this as completed Mar 6, 2018
@lebleut
Copy link

lebleut commented Aug 15, 2018

Hi,
I had the same issue as @IreneStr only when the post is not yet saved (or published )

@aduth
Copy link
Member

aduth commented Aug 15, 2018

@lebleut Could you provide more information on specific reproducible steps, what you're seeing, and what you're expecting to see?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants