Skip to content

Web Services API: images not returned in the JSON of single article GET when a custom field named "images" is present #47301

@PixedBo

Description

@PixedBo

What happened?

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:

  • clean joomla install
  • activate token plugins
  • copy the token form your super-admin user
  • get with curl (or similar) info about a specifc article with ID. Make sure that that article has an intro and a full image set.
  • create a custom filed (i created a media field) with name "images". You can leave the custom field empty in the article.

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.

Version

6.0

Expected result

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": ""
      },
      ......
      }
    }
  }
}

Actual result

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_

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions