Skip to content

Conversation

@kongtiaowang
Copy link
Contributor

@kongtiaowang kongtiaowang commented Oct 28, 2021

Brief summary of changes

if set one module as "No" in the module_manager, user account module can't edit the user ( 500 error)
module[1] = y
module[2] = n
module[3] = y
when one user has module 2 permission, it will call module[2]->getLongName function.

Testing instructions (if applicable)

  1. set one module as "No" in module_manager.
  2. create a new user or edit a user without 500 error.

@kongtiaowang kongtiaowang changed the title [php/libraries/UserPermissions.class.inc] user can't get longname [php/libraries/UserPermissions.class.inc] can't get longname Oct 28, 2021
@kongtiaowang kongtiaowang added 24.0.0-bugs Issues or bug fix PRs that were raised during the testing of release 24.0.0 Category: Bug PR or issue that aims to report or fix a bug Critical to release PR or issue is key for the release to which it has been assigned labels Oct 28, 2021
@driusan
Copy link
Collaborator

driusan commented Oct 29, 2021

why is the query including disabled modules? The line above the loop is $modules = \Module::getActiveModulesIndexed($DB); .. it seems like it would be better to update the query so that $result doesn't include disabled modules.

@kongtiaowang
Copy link
Contributor Author

@driusan The query of getActiveModulesIndexed is correct. The issue is that one user has the permissions for one module, and the module is not activated, although getActiveModulesIndexed is correct , but "$modules[$perm['moduleID']]" will be null.

@driusan
Copy link
Collaborator

driusan commented Nov 1, 2021

Yes, because the $query variable is incorrectly including inactive modules. Why not fix the query in the method being modified?

@kongtiaowang
Copy link
Contributor Author

@driusan yes, you are right. The query has been fixed. Could you review again?

@driusan driusan merged commit 5d82aab into aces:main Nov 11, 2021
@ridz1208 ridz1208 added this to the 24.0.0 milestone Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

24.0.0-bugs Issues or bug fix PRs that were raised during the testing of release 24.0.0 Category: Bug PR or issue that aims to report or fix a bug Critical to release PR or issue is key for the release to which it has been assigned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants