Unit/System Tests bug Webservices Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
12 Sep 2025

Pull Request for Issue #45971.

Summary of Changes

fixed form level.xml

Testing Instructions

use the POST with `` endpoint /api/index.php/v1/users/levels with this payload to create a User Access Level

{
"id":"0",
"title": "aaTechnician",
"rules": "[1,2]"
}

Actual result BEFORE applying this Pull Request

HTTP 400 Bad request

{
    "errors": [
        {
            "title": "Field required: id"
        }
    ]
}

Expected result AFTER applying this Pull Request


HTTP 200 ok
{
    "links": {
        "self": "https://localhost:80/api/index.php/v1/users/levels"
    },
    "data": {
        "type": "levels",
        "id": "16",
        "attributes": {
            "id": 16,
            "title": "aaTechnician",
            "rules": [
                1,
                2
            ]
        }
    }
}

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 - 12 Sep 2025
avatar alikon alikon - change - 12 Sep 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Sep 2025
Category Administration com_users
avatar alikon alikon - change - 12 Sep 2025
The description was changed
avatar alikon alikon - edited - 12 Sep 2025
avatar richard67 richard67 - change - 12 Sep 2025
Title
[5][webservices] Create a user access level via POST
[5.3] [webservices] Create a user access level via POST
avatar richard67 richard67 - edited - 12 Sep 2025
avatar alikon alikon - change - 14 Sep 2025
Labels Added: bug Webservices PR-5.3-dev
avatar laoneo
laoneo - comment - 14 Sep 2025

Would you mind to add a system test for it?

avatar joomla-cms-bot joomla-cms-bot - change - 15 Sep 2025
Category Administration com_users Administration com_users JavaScript Unit Tests
avatar alikon alikon - change - 15 Sep 2025
Labels Added: Unit/System Tests
avatar alikon
alikon - comment - 15 Sep 2025

added some system test

avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar muhme muhme - change - 26 Oct 2025
Title
[5.3] [webservices] Create a user access level via POST
[5.4] [webservices] Create a user access level via POST
avatar muhme muhme - edited - 26 Oct 2025
avatar muhme muhme - change - 26 Oct 2025
Labels Removed: PR-5.3-dev
avatar Razzo1987 Razzo1987 - test_item - 2 Jan 2026 - Tested successfully
avatar Razzo1987
Razzo1987 - comment - 2 Jan 2026

I have tested this item ✅ successfully on 0767cb6


Before patch:

✗ FAIL users_levels_POST_PR46080_1 - POST    /v1/users/levels - 400 - 66.24 ms
✗ FAIL users_levels_POST_PR46080_2 - POST    /v1/users/levels - 400 - 34.47 ms

Details:

────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST    https://joomla.sviluppo.online/api/index.php/v1/users/levels

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/users/levels
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "id": "0",
        "title": "API Test 1 Level 1767370915",
        "rules": "[1,2]"
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 66.24 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Field required: id"
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Field required: id


────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST    https://joomla.sviluppo.online/api/index.php/v1/users/levels

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/users/levels
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "API Test 2 Level 1767370915",
        "rules": "[1,2]"
    }

RESPONSE:
ℹ   Status: 400 (Bad Request)
ℹ   Duration: 34.47 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "errors": [
            {
                "title": "Field required: id"
            }
        ]
    }

✗ ✗ Test failed (HTTP 400)
✗   • Error: Field required: id

After Patch:

✓ PASS users_levels_POST_PR46080_1 - POST    /v1/users/levels - 200 - 87.35 ms
✓ PASS users_levels_POST_PR46080_2 - POST    /v1/users/levels - 200 - 43.59 ms

Details:

────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST    https://joomla.sviluppo.online/api/index.php/v1/users/levels

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/users/levels
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "id": "0",
        "title": "API Test 1 Level 1767371075",
        "rules": "[1,2]"
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 87.35 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/users/levels"
        },
        "data": {
            "type": "levels",
            "id": "7",
            "attributes": {
                "id": 7,
                "title": "API Test 1 Level 1767371075",
                "rules": [
                    1,
                    2
                ]
            }
        }
    }

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


────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST    https://joomla.sviluppo.online/api/index.php/v1/users/levels

REQUEST:
ℹ   Method: POST
ℹ   Endpoint: /v1/users/levels
ℹ   Headers:
    • Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
    • Content-Type: application/vnd.api+json
    • Accept: application/vnd.api+json
ℹ   Payload:
    {
        "title": "API Test 2 Level 1767371075",
        "rules": "[1,2]"
    }

RESPONSE:
ℹ   Status: 200 (OK)
ℹ   Duration: 43.59 ms
ℹ   Headers:
    • Content-Type: application/vnd.api+json; charset=utf-8
ℹ   Body:
    {
        "links": {
            "self": "https://joomla.sviluppo.online/api/index.php/v1/users/levels"
        },
        "data": {
            "type": "levels",
            "id": "8",
            "attributes": {
                "id": 8,
                "title": "API Test 2 Level 1767371075",
                "rules": [
                    1,
                    2
                ]
            }
        }
    }

✓ ✓ Test passed
ℹ   Response contains: 3 item(s)
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/46080">issues.joomla.org/tracker/joomla-cms/46080</a>.</sub>

Add a Comment

Login with GitHub to post a comment