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

[4.4.1]: After changing slugWordSeparator to "/", entries urls in admin panel are broken #12871

Closed
bkrsmanovic opened this issue Mar 12, 2023 · 2 comments
Assignees

Comments

@bkrsmanovic
Copy link

What happened?

Description

Imagine you have structure and your url for that structure is {slug}. Typical url for my structure, if my slug is: contact-bojan would be something like:
https://myawesomecraftsite.com/contact-bojan.

Now if I want to add for this specific page slug like this:
https://myawesomecraftsite.com/contact/contact-bojan, I needed to change slugWordSeparator to "/", and then it allowed me to save. Otherwise, it always replaces "/" with "-" by default.

It gets saved, you open the page it works. But on backend in Entries, you cannot access anymore to that page because admin url of that page is broken.
Example:
This is proper edit URL: /admin/entries/publicPages/1654-contact-bojan

But in admin panel, when I press on my entry, url is something like this:
/admin/entries/publicPages/1654-contact/contact-bojan - and ofc opens up [HTTP 404 – Not Found].

If you press CTRL ALT SAVE instead of normal save, it instantly throws error message.

I think its happening because that slugWordSeparator should affect only frontend, but for some reason it affects backend as well.

Steps to reproduce

  1. Change slugWordSeparator to "/" in General options
  2. Create structure and set for URL {slug}
  3. Add in entry slug word/another-word
  4. Save it
  5. Try to open that page from admin panel - it doesnt work. Even CTRL ALT SAVE gives you an error.
  6. You can manually figure out edit url - which is same as before the save with new slug.

Expected behavior

Backend should properly keep old edit URL and not add according to slug in admin panel / or it should work when slug changes in backend as well.

Actual behavior

Entries URLs are not correct once these steps are done.

Craft CMS version

4.4.1

PHP version

8.1

Operating system and version

Ubuntu 20

Database type and version

MYSQL

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Made the CP edit page URL generation defensive against /s in the slug, for the next Craft 3 and 4 releases.

@brandonkelly
Copy link
Member

Craft 3.8.2 and 4.4.2 are out with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants