No Code Attached Yet Webservices
avatar sirobertson
sirobertson
24 Aug 2025

Steps to reproduce the issue

using the api endpoint /api/index.php/v1/users/levels by postman or php to create an access view level results in an error message
{"errors":[{"title":"Field required: id"}]}

sample php curl (substitute your own website and api token)

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_CAINFO=>$mypemfileloc,
CURLOPT_URL => 'https://mysite.com/api/index.php/v1/users/levels',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{"id":"0",
"title": "aaTechnician",
"rules": "[1,2]",
"attributes":{
"id":"0",
"title": "aaTechnician",
"rules": "[1,2]"}}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'X-Joomla-Token: '.$token
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

have attempted different variations of
CURLOPT_POSTFIELDS => '{"id":"0",
"title": "aaTechnician",
"rules": "[1,2]",
"attributes":{
"id":"0",
"title": "aaTechnician",
"rules": "[1,2]"}}',
or
CURLOPT_POSTFIELDS => '{"id":"0",
"title": "aaTechnician",
"rules": "[1,2]"}',
or
CURLOPT_POSTFIELDS => '{
"title": "aaTechnician",
"rules": "[1,2]"}',

All give the same error
Other endpoints work as expected.

Switching on full logging in Joomla gives a little more information (ip address removed)

#
#Date: 2025-08-24 07:53:29 UTC
#Software: Joomla! 5.3.3 Stable [ Timu ] 19-August-2025 16:00 GMT

#Fields: datetime priority clientip category message
2025-08-24T07:53:29+00:00 CRITICAL xxx.xxx.xxx.xxx error Uncaught Throwable of type Tobscure\JsonApi\Exception\InvalidParameterException thrown with message "Field required: id".
Stack trace:
#0 [ROOT]/libraries/src/MVC/Controller/ApiController.php(327): Joomla\CMS\MVC\Controller\ApiController->save()
#1 [ROOT]/libraries/src/MVC/Controller/BaseController.php(730): Joomla\CMS\MVC\Controller\ApiController->add()
#2 [ROOT]/libraries/src/Dispatcher/ApiDispatcher.php(61): Joomla\CMS\MVC\Controller\BaseController->execute()
#3 [ROOT]/libraries/src/Component/ComponentHelper.php(361): Joomla\CMS\Dispatcher\ApiDispatcher->dispatch()
#4 [ROOT]/libraries/src/Application/ApiApplication.php(433): Joomla\CMS\Component\ComponentHelper::renderComponent()
#5 [ROOT]/libraries/src/Application/ApiApplication.php(116): Joomla\CMS\Application\ApiApplication->dispatch()
#6 [ROOT]/libraries/src/Application/CMSApplication.php(304): Joomla\CMS\Application\ApiApplication->doExecute()
#7 [ROOT]/api/includes/app.php(50): Joomla\CMS\Application\CMSApplication->execute()
#8 [ROOT]/api/index.php(31): require_once('...')
#9 {main}

Expected result

Expected - successful response indicating creation of view level

Actual result

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

and fails to create level

System information (as much as possible)

Joomla! 5.3.3 Stable [ Timu ] 19-August-2025 16:00 GMT
Database Version 10.11.14-MariaDB
PHP Version 8.2.29

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar sirobertson sirobertson - open - 24 Aug 2025
avatar sirobertson sirobertson - change - 24 Aug 2025
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Aug 2025
avatar alikon alikon - change - 24 Aug 2025
Labels Added: Webservices
avatar alikon alikon - labeled - 24 Aug 2025
avatar sirobertson sirobertson - change - 30 Aug 2025
The description was changed
avatar sirobertson
sirobertson - comment - 30 Aug 2025

This is now becoming urgent.
Does anyone have any idea where the source of this error might be in the api code?
I am keen to remedy fully, but would be happy to manually patch the one system i have that i need this api function to work.


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

avatar sirobertson sirobertson - edited - 30 Aug 2025
avatar alikon alikon - change - 12 Sep 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-09-12 10:09:07
Closed_By alikon
avatar alikon alikon - close - 12 Sep 2025
avatar alikon
alikon - comment - 12 Sep 2025

please test #46080

avatar richard67 richard67 - change - 6 Feb 2026
Status Closed New
Closed_Date 2025-09-12 10:09:07
Closed_By alikon
avatar richard67 richard67 - reopen - 6 Feb 2026
avatar richard67
richard67 - comment - 6 Feb 2026

Re-opening as we had to revert the pull request. Details will follow later today or tomorrow.

avatar richard67
richard67 - comment - 7 Feb 2026

Unfortunately we had to revert PR #46080 yesterday because we were building the 5.4.3-rc1 and 6.0.3-rc1 and we had found a small issue in the PR after it was merged which we have missed before:

  • The removal of the filter="intarray" for the "rules" field in the form is not right.
    Clients should use the right payload instead, i.e. no double quotes around the array, i.e. "rules": [1,2] instead of "rules": "[1,2]" in the examples in this issue's description.
  • The removal of the required="true" of the "id" field is fine.
  • The new system tests are of course very welcome.

@alikon We would be happy if you could redo your PR but without the removal of the filter="intarray" for the "rules" field (and with the system tests possibly adapted to that.

Sorry for the inconvenience, and thanks for your contribution, and thanks in advance for the new PR.

Add a Comment

Login with GitHub to post a comment