?
avatar chetanmadaan
chetanmadaan
20 Jul 2020

Steps to reproduce the issue

GET to:
{{base_path}}/api/index.php/v1/content/article/6
You'll see the following fields are available in the Joomla backend but missing in the API.
In order (Top to bottom, left to right).

Field (api field name) Available via API?
Content Tab --
Title(title) Yes
Alias No
Article Text(text) Yes
Publishing Status (state) Yes
Category (catid) Yes
Featured (featured) Yes
Access (access) Yes
Tags (tags) Yes
Note No
Version Note No
Images and links Tab --
Intro Image (image_intro) Yes
Image Float (float_intro) Yes
Alt Text (image_intro_alt) Yes
Caption (image_intro_caption) Yes
Full Article Image (image_fulltext) Yes
Image Float (float_fulltext) Yes
Alt Text (image_fulltext_alt) Yes
Caption (image_fulltext_caption) Yes
Link A No
Link A Text No
Link A URL Target Window No
Link B No
Link B Text No
Link B URL Target Window No
Link C No
Link C Text No
Link C URL Target Window No
Options Tab (fully unavailable) --
Publishing Tab --
Start Publishing No
Finish Publishing No
Start Featured No
Finish Featured No
Created Date No
Created By No
Created by Alias No
Modified Date No
Modified By No
Revision No
Hits No
ID No
Meta Description (metadesc) Yes
Keywords (metakey) Yes
Robots (metadata->robots) Yes
Author (metadata->author) Yes
Content Rights (metadata->rights) Yes

Skipping Edit Screen for now along with permissions Tab as well.

Expected result

In theory all fields available in the backend should be visible via the API too assuming we are gearing towards making with 100% API driven.

Actual result

After the following PR #30134 we have the below result on single article.

{
    "links": {
        "self": "http://localhost/joomla4/api/index.php/v1/content/article/6"
    },
    "data": {
        "type": "articles",
        "id": "6",
        "attributes": {
            "typeAlias": "com_content.article",
            "id": 6,
            "asset_id": 91,
            "title": "Title of Article goes here",
            "state": 1,
            "created": "2020-07-18 10:47:32",
            "images": {
                "image_intro": "",
                "float_intro": "",
                "image_intro_alt": "",
                "image_intro_caption": "",
                "image_fulltext": "",
                "float_fulltext": "",
                "image_fulltext_alt": "",
                "image_fulltext_caption": ""
            },
            "metakey": "This is this",
            "metadesc": "This",
            "access": 1,
            "metadata": {
                "robots": "noindex, follow",
                "author": "Author",
                "rights": "No Rights possible"
            },
            "featured": 1,
            "language": "*",
            "tags": [],
            "text": "My text "
        },
        "relationships": {
            "category": {
                "data": {
                    "type": "categories",
                    "id": "8"
                }
            },
            "author": {
                "data": {
                    "type": "users",
                    "id": "815"
                }
            }
        }
    }
}

System information (as much as possible)

Joomla 4 Beta 2 tested until PR #30134

Additional comments

If approved, most likely assignment for @alikon :)

avatar chetanmadaan chetanmadaan - open - 20 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jul 2020
avatar alikon
alikon - comment - 20 Jul 2020

thank you @chetanmadaan for raising this question
but after #29198 i'll be a little bit more reluctant to propose a PR that pretty much will go in nowhere land

avatar richard67
richard67 - comment - 20 Jul 2020

@alikon Sad to read that. I think #29198 was a special thing. But your other PR #30134 has RTC, so I don't think that one will go to nowhere land, and I also don't assume this here will go there.

Another question is if really all fields mentioned in the table above shall be available in the API, too. Was it intended to be like that? I don't know personally.

avatar chetanmadaan
chetanmadaan - comment - 20 Jul 2020

thank you @chetanmadaan for raising this question
but after #29198 i'll be a little bit more reluctant to propose a PR that pretty much will go in nowhere land

Should be fine

avatar chetanmadaan
chetanmadaan - comment - 20 Jul 2020

@alikon Sad to read that. I think #29198 was a special thing. But your other PR #30134 has RTC, so I don't think that one will go to nowhere land, and I also don't assume this here will go there.

Another question is if really all fields mentioned in the table above shall be available in the API, too. Was it intended to be like that? I don't know personally.

Yeah, I am curious to know the answer too if that was the intention at all in the beginning

avatar wilsonge
wilsonge - comment - 25 Jul 2020

Yes the intention was that pretty much everything should be exposed. com_content is much less fields than others just due to the fact it was the first implementation and the libraries underpinning it were more important than the fields that were exposed at the time (3'ish years ago). Obviously as we move towards stable versions we need to start exposing all the missing fields

avatar chetanmadaan
chetanmadaan - comment - 26 Jul 2020

Thanks @wilsonge.
@alikon on to you Captain.

avatar alikon alikon - change - 27 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-27 17:00:02
Closed_By alikon
avatar alikon alikon - close - 27 Jul 2020
avatar alikon
alikon - comment - 27 Jul 2020

please test #30202

Add a Comment

Login with GitHub to post a comment