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

Initialize slug from the store when in block editor #15857

Merged
merged 3 commits into from
Aug 14, 2020

Conversation

abotteram
Copy link
Contributor

Context

  • Fixes a bug where the slug would not be shown in the snippet editor.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where the slug would not be shown in the snippet editor.

Relevant technical choices:

Test instructions

This PR can be tested by following these steps:

  • Create a new post.
  • Refresh the editor page and make sure the slug is filled in in the snippet editor.
  • Update the slug through the snippet editor and see that the slug is updated in the document settings.
  • Update the slug through the document settings and see that the slug is updated in the snippet editor.
  • Repeat these steps in the classic editor.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #P2-250

@abotteram abotteram added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label Aug 14, 2020
@abotteram abotteram added this to the 14.9 milestone Aug 14, 2020
@hansjovis
Copy link
Contributor

hansjovis commented Aug 14, 2020

Acceptance test: 🚫

getEditedPostSlug is a new selector method introduced in WordPress 5.5. The test fails on 5.4.2.
More specifically: the method has been introduced in Gutenberg 7.8.

@hansjovis
Copy link
Contributor

I am investigating if changing it to a check on the existence of editorSelectors.getEditedPostSlug might work.

Copy link
Contributor

@hansjovis hansjovis left a comment

Choose a reason for hiding this comment

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

CR: 👍

@hansjovis
Copy link
Contributor

hansjovis commented Aug 14, 2020

Acceptance test: ✅

  • For published posts, reloading the page correctly fills in the slug (for 5.4, 5.5, in Gutenberg and the Classic Editor).
  • However, for draft posts this is not the case.
    • Though, this seems to be an existing bug, since it also happens on master. I am not sure what the behavior should be for draft posts, I will check this next monday. So I am going to merge this.

@hansjovis hansjovis merged commit 7b87d7f into trunk Aug 14, 2020
@hansjovis hansjovis deleted the P2-250-fix-slug-initialization-in-block-editor branch August 14, 2020 14:46
@IreneStr IreneStr added changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog and removed changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog labels Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants