No Code Attached Yet bug
avatar MayaSima
MayaSima
16 Aug 2022

Steps to reproduce the issue

Send a POST request to create a new article with a title that contains an em dash

Expected result

"data": {
"type": "articles",
"id": "409",
"attributes": {
"typeAlias": "com_content.article",
"id": 409,
"asset_id": 944,
"title": "We Need Moratorium on Gun Sales — ‘Time to Repeal the 2nd Amendment’",
"alias": "we-need-moratorium-on-gun-sales-time-to-repeal-the-2nd-amendment",
...
}
}

Actual result

"data": {
"type": "articles",
"id": "409",
"attributes": {
"typeAlias": "com_content.article",
"id": 409,
"asset_id": 944,
"title": "We Need Moratorium on Gun Sales — ‘Time to Repeal the 2nd Amendment’",
"alias": "we-need-moratorium-on-gun-sales---time-to-repeal-the-2nd-amendment",
...
}
}

System information (as much as possible)

Joomla! 4.1.5 Stable [ Kuamini ] 21-June-2022 14:00 GMT
MySQL 8.0.30
PHP 8.0.22

Additional comments

When sending a POST request to create a new article (end point {{base_path}}/api/index.php/v1/content/articles), the alias doesn't get generated correctly if the article title contains an em dash.
It gets fixed after you open an article in the editor and save and close it.

avatar MayaSima MayaSima - open - 16 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 16 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Aug 2022
avatar brianteeman
brianteeman - comment - 16 Aug 2022

The character you have posted in your example is not a hyphen. It looks like an em-dash —

avatar MayaSima
MayaSima - comment - 16 Aug 2022

Yes I meant an em dash. It happened a while ago and I was testing a lot with hyphens and first thought it was an issue with hyphens, but it is not.

avatar MayaSima MayaSima - change - 16 Aug 2022
The description was changed
avatar MayaSima MayaSima - edited - 16 Aug 2022
avatar MayaSima
MayaSima - comment - 16 Aug 2022

I fixed the issue description

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment