Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Can't create new users via CLI if username is disabled #1078

Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Mar 28, 2024

Description
Fixes #1076

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Something isn't working label Mar 28, 2024
Copy link
Collaborator

@datamweb datamweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CodeIgniter\Database\Exceptions\DataException]

There is no data to insert.

at SYSTEMPATH\BaseModel.php:1703

Backtrace:
  1    SYSTEMPATH\BaseModel.php:1703
       CodeIgniter\Database\Exceptions\DataException::forEmptyDataset('insert')

  2    SYSTEMPATH\BaseModel.php:742
       CodeIgniter\BaseModel()->transformDataToArray([], 'insert')

  3    SYSTEMPATH\Model.php:730
       CodeIgniter\BaseModel()->insert(Object(CodeIgniter\Shield\Entities\User), false)

  4    VENDORPATH\codeigniter4\shield\src\Models\UserModel.php:265
       CodeIgniter\Model()->insert(Object(CodeIgniter\Shield\Entities\User), false)

  5    SYSTEMPATH\BaseModel.php:692
       CodeIgniter\Shield\Models\UserModel()->insert(Object(CodeIgniter\Shield\Entities\User), false)

  6    VENDORPATH\codeigniter4\shield\src\Models\UserModel.php:327
       CodeIgniter\BaseModel()->save(Object(CodeIgniter\Shield\Entities\User))

  7    VENDORPATH\codeigniter4\shield\src\Commands\User.php:304
       CodeIgniter\Shield\Models\UserModel()->save(Object(CodeIgniter\Shield\Entities\User))

  8    VENDORPATH\codeigniter4\shield\src\Commands\User.php:162
       CodeIgniter\Shield\Commands\User()->create(null, 'hghg@fff.it')

  9    SYSTEMPATH\CLI\Commands.php:65
       CodeIgniter\Shield\Commands\User()->run([...])

 10    SYSTEMPATH\CLI\Console.php:37
       CodeIgniter\CLI\Commands()->run('shield:user', [...])

 11    ROOTPATH\spark:97
       CodeIgniter\CLI\Console()->run()

src/Commands/User.php Outdated Show resolved Hide resolved
@kenjis kenjis requested review from datamweb and sanchawebo April 4, 2024 00:19
@kenjis kenjis merged commit 9ae1651 into codeigniter4:develop Apr 5, 2024
34 checks passed
@kenjis kenjis deleted the fix-command-user-create-validation branch April 5, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Can't create new users via CLI if username is disabled
3 participants