PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar tecpromotion
tecpromotion
5 May 2025

Summary of Changes

This PR extends the user:add CLI command to support assigning user groups either by name (as before) or by numeric ID (new).

The --usergroup option now accepts:
• a group name (e.g. "Super Users")
• a group ID (e.g. 8)
• or a comma-separated list of mixed values (e.g. "2,8,Registered")

Each value is internally checked:
• If it’s numeric and matches an existing ID → accepted
• If it matches an existing group name → accepted
• Otherwise → error

This provides a more flexible developer and automation experience, especially when working with provisioning tools.

Example CLI calls (all valid now):
php cli/joomla.php user:add \ --username="cliadmin" \ --password="Sup3rS3cur3_P4ssw0rt!" \ --email="stefan.wendhausen@community.joomla.org" \ --name="CLI User" \ --usergroup="8"

Testing Instructions

php cli/joomla.php user:add --username=test1 --password=abc123 --email=test1@community.joomla.org --name="Test User" --usergroup="8"

php cli/joomla.php user:add --username=test2 --password=abc123 --email=test2@community.joomla.org --name="Test User" --usergroup="Super Users"

php cli/joomla.php user:add --username=test3 --password=abc123 --email=test3@community.joomla.org --name="Test User" --usergroup="2,3"

php cli/joomla.php user:add --username=test4 --password=abc123 --email=test4@community.joomla.org --name="Test User" --usergroup="Registered,Author,8"

Actual result BEFORE applying this Pull Request

The parameter --usergroup does not work with a user group ID.

Expected result AFTER applying this Pull Request

An ID for a user group is accepted and the user is created.

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 tecpromotion tecpromotion - open - 5 May 2025
avatar tecpromotion tecpromotion - change - 5 May 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 May 2025
Category Libraries
avatar tecpromotion tecpromotion - change - 5 May 2025
Labels Added: PR-6.0-dev
avatar Bodge-IT
Bodge-IT - comment - 19 May 2025

@tecpromotion Just a small nudge to get this over the line, then we can get tests arranged.

d31a92b 20 May 2025 avatar tecpromotion fix
2dd6218 28 May 2025 avatar tecpromotion typo
avatar ceford ceford - test_item - 30 May 2025 - Tested successfully
avatar ceford
ceford - comment - 30 May 2025

I have tested this item ✅ successfully on 9dcc28b


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

avatar muhme
muhme - comment - 30 May 2025

I'm wondering that ShortcutPlugin.cy.js failed three times when running Drone, in both System Tests; but it is passes local test (single and overall System Tests, HTTP and HTTPS in Docker container). Checking the System Tests log (simple to download) shows PHP Warning was found:

> [Fri May 30 16:46:26.805419 2025] [php:warn] [pid 51:tid 51] [client 127.0.0.1:45938] PHP Warning:  Undefined array key "status" in /tests/www/cmysql/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php on line 598, referer: https://localhost/cmysql/administrator/index.php

This code was introduced with PR 45143.
@laoneo Checking the logs is working 😄
@SniperSister Could you please take a look at this and give a fix in 5.4 so we can upmerge this in 6.0?
@richard67 fyi, we have the same issue in 5.4

Update: Fix is already in work:

The system test failure is unrelated from this PR and will be fixed in #45547

Add a Comment

Login with GitHub to post a comment