No Code Attached Yet
avatar jhrenshaw
jhrenshaw
21 Aug 2022

Steps to reproduce the issue

go to CLI directory
php joomla.php user:adduser --username=me --name="My Name" --email=valid_email_address --password="my password" --usergroup=Registered

Expected result

user is added to the user table

Actual result

user is not added to the user table

the return value of $userObj->getError() is something like

'the field otpKey does not have a default value'

There is a similar issue if the field 'otep' is not given a default value

System information (as much as possible)

Additional comments

I think you just need to add

$user['otpKey'] = '';
$user['otep'] = '';

after line 148 in the addUserCommand.php file

avatar jhrenshaw jhrenshaw - open - 21 Aug 2022
avatar jhrenshaw jhrenshaw - change - 21 Aug 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Aug 2022
avatar laoneo
laoneo - comment - 22 Aug 2022

@nikosdion, is this related to the MFA changes of 4.2?

avatar nikosdion
nikosdion - comment - 22 Aug 2022

@laoneo Yes. Please assign this to me, I'll come up with a PR shortly.

avatar nikosdion
nikosdion - comment - 22 Aug 2022

To be fair, the table does give both columns a default value (this is MySQL, the same happens with PostgreSQL):

  `otpKey` varchar(1000) NOT NULL DEFAULT '' COMMENT 'Two factor authentication encrypted keys',
  `otep` varchar(1000) NOT NULL DEFAULT '' COMMENT 'Backup Codes',

It appears that the database table definition is broken on the database server. Still, it's fairly trivial to fix.

avatar nikosdion
nikosdion - comment - 22 Aug 2022

This is the PR #38549

avatar richard67 richard67 - change - 22 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-22 08:35:54
Closed_By richard67
avatar richard67 richard67 - close - 22 Aug 2022
avatar richard67
richard67 - comment - 22 Aug 2022

Closing as having a pull request. Please test #38549 . Thanks in advance.

Add a Comment

Login with GitHub to post a comment