Testing API to retrieve an article via ID ( /api/index.php/v1/content/articles/XXX ) you will not get the images (intro and full text) in the json response if there is an article custom field with name "images".
How to reproduce:
test with something like:
curl.exe -X GET "http://localhost/test-api/api/index.php/v1/content/articles/1" -H "Authorization: Bearer xxxxxxx" -H "Accept: application/vnd.api+json"
where "1" is the ID of the article with images and "xxxxxxx" is the token of the super-admin.
6.0
a JSON with the images in the right place, something like this:
{
"links": {
"self": "http://localhost/test-api/api/index.php/v1/content/articles/1"
},
"data": {
"type": "articles",
"id": "2",
"attributes": {
................
"publish_up": "2026-03-04 16:30:17",
"publish_down": null,
"images": {
"image_intro": "http://localhost/test-api/images/powered_by.png#joomlaImage://local-images/powered_by.png?width=294&height=44",
"image_intro_alt": "",
"float_intro": "",
"image_intro_caption": "",
"image_fulltext": "http://localhost/test-api/images/powered_by.png#joomlaImage://local-images/powered_by.png?width=294&height=44",
"image_fulltext_alt": "",
"float_fulltext": "",
"image_fulltext_caption": ""
},
......
}
}
}
}
The JSON returns empty images[ ] AND the custom field "images" is not present:
"links": {
"self": "http://localhost/test-api/api/index.php/v1/content/articles/1"
},
"data": {
"type": "articles",
"id": "1",
"attributes": {
"typeAlias": "com_content.article",
"id": 1,
"asset_id": 100,
"title": "test1",
"alias": "test1",
"state": 1,
"created": "2026-03-04 16:30:17",
"created_by": 440,
"created_by_alias": "",
"modified": "2026-03-04 16:30:17",
"modified_by": 440,
"publish_up": "2026-03-04 16:30:17",
"publish_down": null,
"images": [],
"urls": {
"urla": "",
"urlatext": "",
"targeta": "",
"urlb": "",
"urlbtext": "",
"targetb": "",
"urlc": "",
"urlctext": "",
"targetc": ""
},
"version": 1,
"metakey": "",
"metadesc": "",
"access": 1,
"hits": 0,
"metadata": {
"robots": "",
"author": "",
"rights": ""
},
"featured": 0,
"language": "*",
"note": "",
"tags": [],
"featured_up": null,
"featured_down": null,
"text": "<p>test1</p> "
},
"relationships": {
"category": {
"data": {
"type": "categories",
"id": "2"
}
},
"created_by": {
"data": {
"type": "users",
"id": "440"
}
},
"tags": {
"data": []
},
"modified_by": {
"data": {
"type": "users",
"id": "440"
}
}
}
}
}```
It seems that the custom field content replace the "images" of the article (the core one)
### System Information
joomla 6.0.3
php 8.3.14
mysql 9.1.0
### Additional Comments
_No response_
| Labels |
Added:
bug
|
||
| Labels |
Added:
No Code Attached Yet
|
||
They are both wrong.
I've created a PR that addresses the problem by:
custom_fields in both single and list article views.You can check out the PR here: #47309
I've created a PR that addresses the problem by:
* Safely exposing `custom_fields` in both single and list article views. * Removing dynamic field injection to stabilize API output. * Ensuring proper handling of tags, images, and multilingual associations. * Triggering content plugins safely to maintain compatibility.You can check out the PR here: #47309
So we have 3 PRs now for the same issue. At least 2 of them are wrong.
It would really be helpful if you guys could check if there is already a PR for an issue before creating your own.
Making concurrent PRs is not really friendly to the authors of the other PRs, and it causes unnecessary work for maintainers.
| Labels |
Added:
Webservices
|
||
Hi @richard67 and @brianteeman,
I noticed both existing PRs (#47304 and #47306) have some issues, so I wanted to explain how my PR #47317 approaches the problem differently.
Concerns with PR #47304:
custom_field_ prefix which is verbose and inconsistent with Joomla conventions.fieldsToRenderItem but does not update fieldsToRenderList, so list endpoints remain affected.displayItem() still pushes raw $field->name into fieldsToRenderItem.cf_images.fieldsToRenderList is not updated so /content/articles list endpoint is still affected.displayItem and prepareItem.cf_ prefix consistently across displayList, displayItem, and prepareItem.property_exists($item, $field->name) to detect runtime collisions.fieldsToRenderItem and fieldsToRenderList.images.Happy to adjust anything based on feedback. Thanks for reviewing...
We have 2 PRs now for this issue: #47304 and #47306 . They are different, so at least one of them might not be right or complete.