User tests: Successful: Unsuccessful:
Pull Request resolves #47740.
Add preprocessSaveData method to handle PATCH requests when no rules in the payload.
send a PATCH to /api/index.php/v1/users/levels/{id} that omits rules
{
"title": "ccTechnician"
}HTTP 200, response body shows rules = [0]. The previous rules array is destroyed silently.
only title is changed, rules is preserved.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Labels |
Added:
Webservices
PR-5.4-dev
|
||
| Category | ⇒ | JavaScript Unit Tests |
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
@adarshdubey03 Can it be that you have reported your test result in the wrong PR? This one here is still draft, and your test result fits better to #47748 .
I have not tested this item.
I have not tested this item.
| Labels |
Added:
Unit/System Tests
|
||
I have tested this item ✅ successfully on a9e23e0
I have tested this item ✅ successfully on a9e23e0
This pull request has conflicts, please resolve those before we can evaluate the pull request.
yes sure i'll do it
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-05-27 12:54:45 |
| Closed_By | ⇒ | alikon | |
| Labels |
Added:
Conflicting Files
|
||
| Status | Closed | ⇒ | New |
| Closed_Date | 2026-05-27 12:54:45 | ⇒ | |
| Closed_By | alikon | ⇒ |
| Status | New | ⇒ | Pending |
| Labels |
Removed:
Conflicting Files
|
||
I have tested this item ✅ successfully on 27b6eef
I was able to test this during the May 29th Friday PR Testing Session - using Postman. Thanks @alikon!
I have tested this item ✅ successfully on 27b6eef
I was able to test this during the May 29th Friday PR Testing Session - using Postman. Thanks @alikon!
| Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
| Labels |
Added:
RTC
|
||
I have tested this item 🔴 unsuccessfully on dd03760
✅ Final test before merge with JBT
api_call "GET" "/v1/users/levels/1"api_call "PATCH" "/v1/users/levels/1" -d "{\"title\": \"IT suport\"}" is destroying rules arrayscripts/test 54 system api/com_users/Levels.cy.js
can update a users access level test does not cover the actual regression: the rules array is destroyed when updating another attribute.title attribute correctly leaves the rules array unchanged.I have tested this item 🔴 unsuccessfully on dd03760
✅ Final test before merge with JBT
api_call "GET" "/v1/users/levels/1"api_call "PATCH" "/v1/users/levels/1" -d "{\"title\": \"IT suport\"}" is destroying rules arrayscripts/test 54 system api/com_users/Levels.cy.js
can update a users access level test does not cover the actual regression: the rules array is destroyed when updating another attribute.title attribute correctly leaves the rules array unchanged.I have tested this item 🔴 unsuccessfully on dd03760
Final test before merge with JBT
api_call "GET" "/v1/users/levels/1"api_call "PATCH" "/v1/users/levels/1" -d "{\"title\": \"IT suport\"}" is destroying rules arrayscripts/test 54 system api/com_users/Levels.cy.js
can update a users access level test does not cover the actual regression: the rules array is destroyed when updating another attribute.title attribute correctly leaves the rules array unchanged.| Status | Ready to Commit | ⇒ | Pending |
back to pending
back to pending
@alikon First, thank you for your contribution and for updating the System Tests 👍
What I am asking about is, the updated can update a users access level test doesn't cover this PRs and the issue. The destroyed rules array isn't checked. The test passes even before this PR fix.
Would it make sense to extend the test by storing the complete object before the update and comparing it afterwards? In that case, the test would fail before the fix and passed afterwards.
| Labels |
Removed:
RTC
|
||
✅ Counting still as RTC as only System Tests are changed and they passed
✅ Final Re-test before merge with JBT
can patch a users access level and check the rules failstitle attribute correctly leaves the rules array unchanged| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-06-04 09:48:34 |
| Closed_By | ⇒ | muhme |
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47751.