You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the entry title is in the format UPPERCASElowercase (for example "VAPORwave") a hyphen is added to the slug before the last uppercase letter, even if there are no spaces at all in the original string (so the previous example would become "vapo-rwave" in the slug).
Steps to reproduce
Create an entry with a title that has an uppercase portion and a lowercase portion, in that order, with no spaces.
2.Save the entry and check the automatically generated slug. A hyphen should appear between the final and the penultimate letter of the uppercase portion.
Additional info
Craft version:Craft Pro 3.1.28
PHP version:7.3.1
Database driver & version:MySQL 5.5.5
The text was updated successfully, but these errors were encountered:
RoseDMH
changed the title
Slug generation
Slug generation breaks when the first part of entry name is uppercase
May 22, 2019
That is expected behavior. Craft is interpreting this as an uppercase word (VAPO) followed by a camel-cased word (Rwave), which is generally a safe assumption with strings like this. (For example, see the oldHTMLFile example in the Camel Case Wikipedia entry.)
Also perhaps related to the above and #4266 - I am seeing the following:
My title field is setup as follows {hotTubName}{stockCode} and then when I enter the following into the Stock Code field: 18T1018 it is creating the slug as follows: sundance18-t1018 - I wouldn't expect this behaviour, I would expect the slug to be sundance18t1018
For now I have changed my title field to {hotTubName}-{stockCode|lower}
Description
SIMILAR to #4266, possibly related.
When the entry title is in the format UPPERCASElowercase (for example "VAPORwave") a hyphen is added to the slug before the last uppercase letter, even if there are no spaces at all in the original string (so the previous example would become "vapo-rwave" in the slug).
Steps to reproduce
2.Save the entry and check the automatically generated slug. A hyphen should appear between the final and the penultimate letter of the uppercase portion.
Additional info
The text was updated successfully, but these errors were encountered: