Adding punctuation to the end of a slug doesn't update the slug field
See original GitHub issueIssue Summary
If you add punctuation to the end of a slug (slug!
) so that the server replies with slug-2
, the slug field doesn’t update and the post is not saved.
Steps to Reproduce
- Open web inspector so that network requests are recorded
- Open a post in the editor
- In the settings menu “Post URL” field, add punctuation to the end of the text then click off of the input so it updates
- eg, if the existing slug was
hello
, you would puthello!
in the URL field - there should be a GET request to get a slug from the server, if you look at the response it should be something like
hello-2
- eg, if the existing slug was
- Note that the punctuation is still shown in the URL field and that no PUT request was made to update the post
Technical details:
- Ghost Version: 1.18.0
- Browser/OS: Chrome/macOS
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
All About Slugs (Not the Slimy Kind) | The Daily Post
No punctuation. Slugs are lowercase letters and numbers only. Punctuation will be automatically removed, which could leave you with meaningless ...
Read more >Make slug fields optional for all models · Issue #8113 · netbox ...
Using names, you add additional formatting potential (punctuation, additional characters, etc) which aren't allowed in a slug field.
Read more >How to Fix WordPress Page Slug Not Updating - Convology
There are two main reasons why WordPress page slugs, or the URL of the page in WordPress, won't edit even if you go...
Read more >How to convert a Title to a URL slug in jQuery? - Stack Overflow
What I'd like to do is remove the punctuation, convert it to lowercase, and replace the spaces with hyphens.
Read more >slug - Apostrophe 3 Documentation
Text entered in a slug field is immediately lower-cased and all spaces and punctuation are replaced by dashes ( - ).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kevinansfield - I’ve investigated the issue some and here’s what I’ve found.
hello!
in the slug field, it returnshello-2
I’m not sure what the expected behaviour is here. The original change there was made as part of this commit - https://github.com/TryGhost/Ghost-Admin/commit/e772430bd6ac8d32ba4029e96087c53e261c182a#diff-30dc1eff6ae6709c67989797bd574a92
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.