Create an article via a POST call to Joomla API and send an array of tag_ids
"tags": {
"27": "Politics",
"673": "Spencer Lindquist",
"674": "Social Justice",
"675": "Critical Race Theory",
"676": "Dei",
"677": "Drug Overdose",
"678": "Woke",
"679": "Crt"
},
"tags": {
"27": "Critical Race Theory",
"673": "Crt",
"674": "Dei",
"675": "Drug Overdose",
"676": "Politics",
"677": "Social Justice",
"678": "Spencer Lindquist",
"679": "Woke"
},
Joomla! 4.1.5 Stable [ Kuamini ] 21-June-2022 14:00 GMT
PHP 8.0.21
MySQL 8.0.29
Summary
When creating an article via a POST call to Joomla API and sending an array of tag_ids, Joomla API returns a response with tags object being populated:
Sent:
"tags": [
"675",
"674",
"676",
"677",
"678",
"679",
"27",
"673"
],
Received:
"tags": {
"27": "Critical Race Theory",
"673": "Crt",
"674": "Dei",
"675": "Drug Overdose",
"676": "Politics",
"677": "Social Justice",
"678": "Spencer Lindquist",
"679": "Woke"
},
However, the mappings between ids and tag names are wrong. See the correct ids for each tag as configured in Joomla on this screenshot:
A subsequent GET call to the same article, which has just been created, results in a response with tag array being empty:
"tags": []
Running PATCH request for the same article with the same list of tag_ids yields the exact same behavior, but the tags do not get wiped anymore.
Subsequent GET calls continue return result with the correct set of tags, but wrong mappings between ids and names.
Making GET request to tags endpoint ({{base_path}}/api/index.php/v1/tags) returns correct mapping for all tags, so the issue is only on the article level.
Temporary Workaround
To work around this problem, I have to make a PATCH request with the same payload right after making a POST request for every new article.
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
?
|
I am passing the tag id's.
Labels |
Added:
bug
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-20 07:23:26 |
Closed_By | ⇒ | alikon |
you need to pass the tag id's and not the tag's title