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

Plugin set up page broken if one of the configured roles is deleted #379

Open
dmitriim opened this issue May 3, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@dmitriim
Copy link
Member

dmitriim commented May 3, 2023

Steps to replicate:

  1. Create a dummy role.
  2. Navigate to /admin/settings.php?section=managemfa and enable Role factor
  3. Configure role factor by selecting role created on step 1 and save settings.
  4. Delete the role from step 1.
  5. Navigate to /admin/settings.php?section=managemfa and you will see below error.
Exception - Argument 1 passed to role_get_name() must be an instance of stdClass, bool given, called in [dirroot]/admin/tool/mfa/factor/role/classes/factor.php on line 156

More information about this error

error

Error
Debug info:
Error code: generalexceptionmessage
error

Error
Stack trace:
line 4469 of /lib/accesslib.php: TypeError thrown
line 156 of /admin/tool/mfa/factor/role/classes/factor.php: call to role_get_name()
line 206 of /admin/tool/mfa/classes/local/admin_setting_managemfa.php: call to factor_role\factor->get_summary_condition()
line 81 of /admin/tool/mfa/classes/local/admin_setting_managemfa.php: call to tool_mfa\local\admin_setting_managemfa->define_factor_combinations_table()
line 1657 of /lib/adminlib.php: call to tool_mfa\local\admin_setting_managemfa->output_html()
line 159 of /admin/settings.php: call to admin_settingpage->output_html()
@dmitriim dmitriim added the bug Something isn't working label May 3, 2023
stevandoMoodle pushed a commit to stevandoMoodle/moodle that referenced this issue Jul 31, 2023
1. Add missing authenticator name lang string
2. Check nosetup factor correctly to display menu
3. Align email page controls with manager
4. Add explanation text to login page
5. Fixed "Access to an undefined property .." from PHPStan
6. Fixed all the "Variable $.. might not be defined" from PHPStan
7. Fixed the issue from catalyst/moodle-tool_mfa#379

Co-authored-by: Peter Burnett <[email protected]>
Co-authored-by: Alex Morris <[email protected]>
stevandoMoodle added a commit to stevandoMoodle/moodle that referenced this issue Aug 15, 2023
In this commit, there are couple of fixes based on the report:
1. Removed legacy polyfill from provider.php
2. Fixed phpunit warning detected by CodeChecker
3. Removed unused files
4. Fixed the PHPunit failures by removing "securityquestions"
   from the data_provider due to it has not been included as one of the factors
5. Added PHPunit test to the factors that can be unittested
6. Removed !important rule from tool_mfa/styles.css
7. Added (int) type to sleep method within sleep_timer method due to a php deprecation
in too_mfa/classes/manager.php
8. Changed last param form bool to string in not_enough_factors() when initiating
a new single_button object in tool_mfa/renderer.php
9. Add explanation text to login page
10. Fixed "Access to an undefined property .." from PHPStan
12. Fixed all the "Variable $.. might not be defined" from PHPStan
13. Fixed the issue from catalyst/moodle-tool_mfa#379
stevandoMoodle added a commit to stevandoMoodle/moodle that referenced this issue Aug 25, 2023
In this commit, there are couple of fixes based on the report:
1. Removed legacy polyfill from provider.php
2. Fixed phpunit warning detected by CodeChecker
3. Removed unused files
4. Fixed the PHPunit failures by removing "securityquestions"
   from the data_provider due to it has not been included as one of the factors
5. Added PHPunit test to the factors that can be unittested
6. Removed !important rule from tool_mfa/styles.css
7. Added (int) type to sleep method within sleep_timer method due to a php deprecation
in too_mfa/classes/manager.php
8. Changed last param form bool to string in not_enough_factors() when initiating
a new single_button object in tool_mfa/renderer.php
9. Add explanation text to login page
10. Fixed "Access to an undefined property .." from PHPStan
12. Fixed all the "Variable $.. might not be defined" from PHPStan
13. Fixed the issue from catalyst/moodle-tool_mfa#379
stevandoMoodle added a commit to stevandoMoodle/moodle that referenced this issue Aug 29, 2023
In this commit, there are couple of fixes based on the report:
1. Removed legacy polyfill from provider.php
2. Fixed phpunit warning detected by CodeChecker
3. Removed unused files
4. Fixed the PHPunit failures by removing "securityquestions"
   from the data_provider due to it has not been included as one of the factors
5. Added PHPunit test to the factors that can be unittested
6. Removed !important rule from tool_mfa/styles.css
7. Added (int) type to sleep method within sleep_timer method due to a php deprecation
in too_mfa/classes/manager.php
8. Changed last param form bool to string in not_enough_factors() when initiating
a new single_button object in tool_mfa/renderer.php
9. Add explanation text to login page
10. Fixed "Access to an undefined property .." from PHPStan
12. Fixed all the "Variable $.. might not be defined" from PHPStan
13. Fixed the issue from catalyst/moodle-tool_mfa#379
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

No branches or pull requests

1 participant