TransWikia.com

Error accessing entry when title has special characters

Craft CMS Asked by Frederico Leonardo on April 27, 2021

I came across a weird bug with a title containing a "%" character not converting into a proper slug. So the website editor created the title "Berlenga: a 100% sustainable island" that didn’t get turned into a proper slug. It generated the slug exactly as the title. When she went to make changes, Craft threw in a bad request error.

I was able to edit the slug inside the database and she got back access the entry, but I am wondering if there is a way to prevent this from happening again. I’m using the "Slug Equals Title" plugin, which works greatly for localised entries, and I did activate "limitAutoSlugsToAscii". Is there something else I need to do?

Thanks!

One Answer

I've never used that plugin, but it looks like they do respect Craft's limitAutoSlugsToAscii config setting, which should prevent a % from getting into the slug.

https://github.com/internetztube/craft-slug-equals-title/blob/master/src/SlugEqualsTitle.php#L45-L47

But that setting only applies to new entries and newly created slugs, and I'm guessing you enabled the Craft limitAutoSlugsToAscii config setting after the entry in question was already created.

You should be good going forward, though.

Correct answer by Brad Bell on April 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP