moodle-tool_mfa
moodle-tool_mfa copied to clipboard
Plugin set up page broken if one of the configured roles is deleted
Steps to replicate:
- Create a dummy role.
- Navigate to /admin/settings.php?section=managemfa and enable Role factor
- Configure role factor by selecting role created on step 1 and save settings.
- Delete the role from step 1.
- 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()