Skip to content

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Oct 5, 2025

Description
This PR fixes a bug affecting UserModel::withPermissions(), which caused users without permissions to trigger additional, unnecessary database queries. The same behavior was implemented for the UserModel::withGroups() for unification.

Bug reported here: #1257 (comment)

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

@michalsn michalsn added the bug Something isn't working label Oct 5, 2025
@dgvirtual
Copy link
Contributor

I can confirm that upon implementing these changes in the code Bonfire2 user list does not make lazy loading database queries for permissions. Query number got down from 25 to 10.

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.

@michalsn Thank you!

@datamweb datamweb merged commit 8bf6f42 into codeigniter4:develop Oct 8, 2025
39 checks passed
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.

3 participants