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

Post Slug not editable until post is set to a non-custom post status #523

Closed
kjbenk opened this issue Oct 4, 2019 · 2 comments
Closed
Assignees
Milestone

Comments

@kjbenk
Copy link

kjbenk commented Oct 4, 2019

When Gutenberg is enabled I am seeing an issue where the post slug field is not saved, specifically it is cleared out entirely, when a post is saved with a custom status. I have traced done this issue to this code - https://github.com/Automattic/Edit-Flow/blob/0.9/modules/custom-status/custom-status.php#L1395-L1431. It appears that since the $_POST['post_name'] element is not set when editing a post in Gutenberg, the function always thinks the user did not set a custom slug, and therefore it clears the post slug.

I have done some rough testing and I believe this logic can be removed entirely since the custom post status API has been updated over the years to better support custom post slugs.

@mjangda mjangda self-assigned this Nov 1, 2019
@mjangda mjangda added this to the 0.9.2 milestone Nov 4, 2019
@cojennin cojennin modified the milestone: 0.9.3 Nov 26, 2019
This was referenced Jan 8, 2020
@cojennin
Copy link
Contributor

@kjbenk thanks for reporting this. I think #575 should fix it, and I've added enough testing to hopefully catch most of the corner cases.

When I removed that entire function (fix_post_name), the post_name was getting permanently set (which prevented the slug from updating if the user had not intentionally set it). If you can take a look at that PR, that'd be fantastic, could use a few more eyes

@htdat
Copy link
Member

htdat commented Apr 12, 2021

@kjbenk - I've tested this issue in Gutenberg and it no longer happens. I believe #575 has already fixed this issue.

I am closing this issue now but if the issue is still there, feel free to reopen it.

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

No branches or pull requests

4 participants