User tests: Successful: Unsuccessful:
Pull Request for Issue #38277 .
Adds (if not already present in the payload) the groups array to allow PATCH requests without the explicit need of supplying the user groups
Save failed with the following error: You can't save a user account without selecting at least one user group.

Please select:
"groups": [
"2"
],
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Labels |
Added:
PR-5.4-dev
|
||
| Title |
|
||||||
In my honest opinion this is a bug - the PATCH request should allow the API to modify user data without the need to specify the groups in EVERY request, eg. changing an email address should suffice with a payload of {"email":"new@email.com"} instead of {"email":"new@email.com","groups":{"2":2}}
I have tested this item ✅ successfully on 1bb91c7
;( PR Test Unsuccessful... CAN'T match BEFORE condition
If I try a GET https://www.domain.com/_j540/api/index.php/v1/users/265, I get the user data no problem...
if I try a PATCH https://www.domain.com/_j540/api/index.php/v1/users/265, I get this error message:
{
"errors": [
{
"title": "Field required: Email Notifications"
}
]
}
400 Bad Request...
| Labels |
Added:
bug
Webservices
|
||
@OctavianC Not really a good idea to trigger a branch update when that is not really necessary (e.g. due to conflicts). Any new commit (including a branch update) resets the human test counter in the issue tracker, which makes it then impossible to find a PR when checking for number of tests, e.g. to see when it has 2 good tests so we can set it RTC. I have to restore @alikon 's test result in the issue tracker now.
Didn't know that.
Didn't know that.
@OctavianC All ok. In general it is not a problem when a PR's branch is shown as outdated to the base branch on GitHub. Only when GitHub shows conflicts it needs to do something.
I have tested this item ✅ successfully on 8ffa857
Unsuccessful Test - Something seems very dangerous is happening here - overwriting of data (username, etc) in Joomla.
Late, I will write specifics tomorrow when I wake up.
OK, so:
400 Bad Request...
as stated above
IF you select a user that is Super User, you get the same:
{
"errors": [
{
"title": "Field required: Email Notifications"
}
]
}
IF you select a user with multiple access levels - as long as 1 of them is Super User - same error as above, (seems logical in the context that for some reason Super User blocks the editing of the User)
IF you select a user that is ANY other level it seems, I've tested Administrator, Registered, Publisher so far:
It OVERWRITES the User's Data WITHOUT the PR completely with:
{
"links": {
"self": "https://www.domain.com/_j543/api/index.php/v1/users/15"
},
"data": {
"type": "users",
"id": "14",
"attributes": {
"groups": {
"2": 2
},
"id": 14,
"name": "name",
"username": "username",
"email": "new@example.org",
"block": 0,
"sendEmail": 0,
"registerDate": "2026-01-28 11:22:58",
"lastvisitDate": null,
"lastResetTime": null,
"resetCount": 0
}
}
}
It OVERWRITES the User's Data WITH the PR applied complete with:
{
"links": {
"self": "https://www.domain.com/_j543/api/index.php/v1/users/14"
},
"data": {
"type": "users",
"id": "15",
"attributes": {
"groups": {
"2": 2
},
"id": 15,
"name": "name",
"username": "username",
"email": "new@example.org",
"block": 0,
"sendEmail": 0,
"registerDate": "2026-01-28 11:25:15",
"lastvisitDate": null,
"lastResetTime": null,
"resetCount": 0
}
}
}
(the User ID moved up 1 because it was a new user which makes sense)
@richard67 you are correct, I meant to select Unsuccessful, I tried to Alter Test to Unsuccessful and it shows in Joomla Issue Tracker now as altered to Unsuccessful but not on Github.
I'll update the test result now with what I found.
I have tested this item 🔴 unsuccessfully on 8ffa857
I have tested this unsuccessfully with the explanation above:
#46750 (comment)
Please provide more details on what payload you are using, what is the API URL and request method and what exactly is being overridden as I'm not sure I understand what the issue is.
My fix is simply to allow PATCH without the groups array in the payload - see the discussion here #38277 (comment). The Field required: Email Notifications error I can trace as being related to the Action Log - Joomla plugin; once this plugin is disabled the correct Save failed with the following error: You can't save a user account without selecting at least one user group. error shows up for Super Users as well, but that's another issue entirely...
Please provide more details on what payload you are using, what is the API URL and request method and what exactly is being overridden as I'm not sure I understand what the issue is. My fix is simply to allow PATCH without the groups array in the payload - see the discussion here #38277 (comment). The
Field required: Email Notificationserror I can trace as being related to theAction Log - Joomlaplugin; once this plugin is disabled the correctSave failed with the following error: You can't save a user account without selecting at least one user group.error shows up for Super Users as well, but that's another issue entirely...
Hi @OctavianC, lesson learned, I am using Postman and when you spin up postman, open up the Joomla Workspace and select the "Joomla Web Services Collection for Postman" collection and then choose: 14. Users --> 14.1 Users --> PATCH users/{user_id}, it opens up the right hand interface to Authorization to which I choose Bearer Token and I put in my Joomla API Token, it (Postman) automatically put in the Body Tab, the payload of: {"email":"new@example.org","groups":["2"],"name":"name","username":"username"}
which explains why via PATCH it overwrites the user data...
I have replaced that default text and put what is in your screenshot and it works - sorry for not having seen that.
I'll update the test to successful as I was able to confirm it.
I have tested this item ✅ successfully on 8ffa857
I was able to test this successfully (once I removed the default payload and replaced it with the correct one) sorry @OctavianC and THANK YOU for getting me to find the issue.
Thanks for testing!
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
|
||
✅ Final test before merge with JBT
curl -k -X GET -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://host.docker.internal:7154/api/index.php/v1/users/42 | jqcurl -k -X PATCH -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://host.docker.internal:7154/api/index.php/v1/users/42 -d '{ "email": "new@example.com"}'| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-01-28 20:55:52 |
| Closed_By | ⇒ | muhme |
Thank you @OctavianC for your contribution. Thank you @alikon and @exlemor for testing.
@OctavianC Is this PR a bug fix or a new feature? I‘m asking because the initial issue was labeled as feature request.