RTC Unit/System Tests Webservices PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
22 Sep 2025

Pull Request for Issue #45470 .

Summary of Changes

fixes inconsistent behavior between the Joomla backend Interface and the Web Services (API) when creating an article with an alias that already exists in the same category.

Testing Instructions

  • Ensure you have at least one category and an existing article within that category (e.g., an article with the alias "my-test-article" in the "Uncategorised" category).

  • Use an API client (like Postman) or write a script to send a POST request to the /api/index.php/v1/content/articles endpoint.

  • Send a JSON payload that will create a duplicate alias in the same category. For example:

{
  "title": "My Test Article",
  "alias": "my-test-article",
  "catid": 2,
  "articletext": "This is the article text.",
  "state": 1,
  "language": "*",
}

Actual result BEFORE applying this Pull Request

the API returns a HTTP 400 error with the message: Save failed with the following error: Another Article in this category has the same alias.

Expected result AFTER applying this Pull Request

Verify that the new article has been created and its alias has been modified (e.g., to my-test-article-1).

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar alikon alikon - open - 22 Sep 2025
avatar alikon alikon - change - 22 Sep 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2025
Category Administration com_content
avatar richard67 richard67 - change - 22 Sep 2025
Title
same alias behavoir for webservices
[6.1] Same alias behavior for webservices
avatar richard67 richard67 - edited - 22 Sep 2025
99f1c0c 22 Sep 2025 avatar alikon cs
avatar alikon alikon - change - 22 Sep 2025
Labels Added: PR-6.1-dev
avatar alikon alikon - change - 22 Sep 2025
The description was changed
avatar alikon alikon - edited - 22 Sep 2025
232c813 22 Sep 2025 avatar alikon cs
412692f 22 Sep 2025 avatar alikon cs
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2025
Category Administration com_content Administration com_content JavaScript Unit Tests
fdfd0db 22 Sep 2025 avatar alikon alias
avatar alikon alikon - change - 22 Sep 2025
Labels Added: Unit/System Tests
avatar alikon alikon - change - 24 Sep 2025
The description was changed
avatar alikon alikon - edited - 24 Sep 2025
avatar alikon alikon - change - 5 Oct 2025
Labels Added: Webservices
avatar Razzo1987 Razzo1987 - test_item - 2 Jan 2026 - Tested successfully
avatar Razzo1987
Razzo1987 - comment - 2 Jan 2026

I have tested this item ✅ successfully on 754e306

Note:
@alikon: You forgot the language in Testing Instructions, see content_articles_POST_PR46144_1 in Details ;)

Before patch:

✗ FAIL content_articles_POST_PR46144_1 - POST    /v1/content/articles - 400 - 93.75 ms
✓ PASS content_articles_POST_PR46144_1bis - POST    /v1/content/articles - 200 - 178.26 ms
✗ FAIL content_articles_POST_PR46144_2 - POST    /v1/content/articles - 400 - 47.97 ms
✗ FAIL content_articles_POST_PR46144_3 - POST    /v1/content/articles - 400 - 46.76 ms
Details

─── Create article with specific alias (PR #46144 - Test 1) [content_articles_POST_PR46144_1] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "articletext": "This is Test 1: Creating article with specific alias.",
        "state": 1
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 93.75 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Save failed with the following error: Field 'language' doesn't have a default value",
                "code": 400
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Save failed with the following error: Field 'language' doesn't have a default value


─── Create article with specific alias (PR #46144 - Test 1) [content_articles_POST_PR46144_1bis] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 1: Creating article with specific alias.",
        "state": 1
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 178.26 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/content/articles"
        },
        "data": {
            "type": "articles",
            "id": "1",
            "attributes": {
                "typeAlias": "com_content.article",
                "id": 1,
                "asset_id": 103,
                "title": "PR46144 Test Article",
                "alias": "pr46144-test-article",
                "state": 1,
                "created": "2026-01-02 16:59:56",
                "created_by": 126,
                "created_by_alias": "",
                "modified": "2026-01-02 16:59:56",
                "modified_by": 126,
                "publish_up": "2026-01-02 16:59:56",
                "publish_down": null,
                "images": [],
                "urls": [],
                "version": 1,
                "metakey": "",
                "metadesc": "",
                "access": 1,
                "hits": 0,
                "metadata": [],
                "featured": 0,
⚠     ... (32 more lines)

✓ ✓ Test passed
ℹ   Response contains: 4 item(s)


─── Create article with duplicate alias (PR #46144 - Test 2) [content_articles_POST_PR46144_2] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 2: Creating article with duplicate alias (should auto-increment to pr46144-test-article-1).",
        "state": 1
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 47.97 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Save failed with the following error: Another Article in this category has the same alias.",
                "code": 400
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Save failed with the following error: Another Article in this category has the same alias.


─── Create article without alias (PR #46144 - Test 3) [content_articles_POST_PR46144_3] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 3: Creating article without alias (should auto-generate from title).",
        "state": 1
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 46.76 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Save failed with the following error: Another Article in this category has the same alias.",
                "code": 400
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Save failed with the following error: Another Article in this category has the same alias.

After patch:

✗ FAIL content_articles_POST_PR46144_1 - POST    /v1/content/articles - 400 - 99.42 ms
✓ PASS content_articles_POST_PR46144_1bis - POST    /v1/content/articles - 200 - 157.68 ms
✓ PASS content_articles_POST_PR46144_2 - POST    /v1/content/articles - 200 - 118.07 ms
✓ PASS content_articles_POST_PR46144_3 - POST    /v1/content/articles - 200 - 118.28 ms

Note: content_articles_POST_PR46144_1 correctly fails beacause it doesn't have language.

Details

─── Create article with specific alias (PR #46144 - Test 1) [content_articles_POST_PR46144_1] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjI2MDo1NzIxZmIzZGMwZT...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "articletext": "This is Test 1: Creating article with specific alias.",
        "state": 1
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 99.42 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Save failed with the following error: Field 'language' doesn't have a default value",
                "code": 400
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Save failed with the following error: Field 'language' doesn't have a default value


─── Create article with specific alias (PR #46144 - Test 1) [content_articles_POST_PR46144_1bis] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjI2MDo1NzIxZmIzZGMwZT...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 1: Creating article with specific alias.",
        "state": 1
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 157.68 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/content/articles"
        },
        "data": {
            "type": "articles",
            "id": "1",
            "attributes": {
                "typeAlias": "com_content.article",
                "id": 1,
                "asset_id": 103,
                "title": "PR46144 Test Article",
                "alias": "pr46144-test-article",
                "state": 1,
                "created": "2026-01-02 17:03:42",
                "created_by": 260,
                "created_by_alias": "",
                "modified": "2026-01-02 17:03:42",
                "modified_by": 260,
                "publish_up": "2026-01-02 17:03:42",
                "publish_down": null,
                "images": [],
                "urls": [],
                "version": 1,
                "metakey": "",
                "metadesc": "",
                "access": 1,
                "hits": 0,
                "metadata": [],
                "featured": 0,
⚠     ... (32 more lines)

✓ ✓ Test passed
ℹ   Response contains: 4 item(s)


─── Create article with duplicate alias (PR #46144 - Test 2) [content_articles_POST_PR46144_2] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjI2MDo1NzIxZmIzZGMwZT...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "alias": "pr46144-test-article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 2: Creating article with duplicate alias (should auto-increment to pr46144-test-article-1).",
        "state": 1
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 118.07 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/content/articles"
        },
        "data": {
            "type": "articles",
            "id": "2",
            "attributes": {
                "typeAlias": "com_content.article",
                "id": 2,
                "asset_id": 104,
                "title": "PR46144 Test Article",
                "alias": "pr46144-test-article-2",
                "state": 1,
                "created": "2026-01-02 17:03:42",
                "created_by": 260,
                "created_by_alias": "",
                "modified": "2026-01-02 17:03:42",
                "modified_by": 260,
                "publish_up": "2026-01-02 17:03:42",
                "publish_down": null,
                "images": [],
                "urls": [],
                "version": 1,
                "metakey": "",
                "metadesc": "",
                "access": 1,
                "hits": 0,
                "metadata": [],
                "featured": 0,
⚠     ... (32 more lines)

✓ ✓ Test passed
ℹ   Response contains: 4 item(s)


─── Create article without alias (PR #46144 - Test 3) [content_articles_POST_PR46144_3] ───
POST    https://joomla.sviluppo.online/api/index.php/v1/content/articles

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/content/articles
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjI2MDo1NzIxZmIzZGMwZT...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "PR46144 Test Article",
        "catid": 2,
        "language": "*",
        "articletext": "This is Test 3: Creating article without alias (should auto-generate from title).",
        "state": 1
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 118.28 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/content/articles"
        },
        "data": {
            "type": "articles",
            "id": "3",
            "attributes": {
                "typeAlias": "com_content.article",
                "id": 3,
                "asset_id": 105,
                "title": "PR46144 Test Article",
                "alias": "pr46144-test-article-3",
                "state": 1,
                "created": "2026-01-02 17:03:42",
                "created_by": 260,
                "created_by_alias": "",
                "modified": "2026-01-02 17:03:42",
                "modified_by": 260,
                "publish_up": "2026-01-02 17:03:42",
                "publish_down": null,
                "images": [],
                "urls": [],
                "version": 1,
                "metakey": "",
                "metadesc": "",
                "access": 1,
                "hits": 0,
                "metadata": [],
                "featured": 0,
⚠     ... (32 more lines)

✓ ✓ Test passed
ℹ   Response contains: 4 item(s)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46144.
avatar alikon alikon - change - 2 Jan 2026
The description was changed
avatar alikon alikon - edited - 2 Jan 2026
avatar alikon
alikon - comment - 2 Jan 2026

@Razzo1987 thanks added the missing "language": "*", in the payload test instructions

avatar exlemor exlemor - test_item - 24 Jan 2026 - Tested successfully
avatar exlemor
exlemor - comment - 24 Jan 2026

I have tested this item ✅ successfully on 754e306

HI @alikon, I was able to test this successfully! - thanks to the help of @Razzo1987!

At least with Postman, the JSON load package had to be adjusted to:

{
  "title": "My Test Article",
  "alias": "my-test-article",
  "catid": 2,
  "articletext": "This is the article text.",
  "state": 1,
  "language": "*"
}

( "language": "*" not "language": "*", )

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46144.
avatar richard67 richard67 - change - 25 Jan 2026
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 25 Jan 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46144.

avatar tecpromotion tecpromotion - change - 29 Jan 2026
Labels Added: RTC
avatar tecpromotion tecpromotion - change - 29 Jan 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-01-29 15:25:41
Closed_By tecpromotion
avatar tecpromotion tecpromotion - close - 29 Jan 2026
avatar tecpromotion tecpromotion - merge - 29 Jan 2026

Add a Comment

Login with GitHub to post a comment