fix: Removes login page error check for usergrades

Eliminates redundant $hassiteconfig condition, preventing potential
login page errors as site configuration check is unnecessary for
accessing the user grades report administration.

Updates URL concatenation to use $CFG->wwwroot for consistency.
This commit is contained in:
Kumi 2024-11-20 18:15:02 +01:00
parent 8d339008c1
commit d3eed13d51
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -1,11 +1,9 @@
<?php
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) { // Needs this condition or there is error on login page
$ADMIN->add('reports', new admin_externalpage(
'report_usergrades',
get_string('pluginname', 'report_usergrades'),
new moodle_url('/report/usergrades/index.php'),
'report/usergrades:view'
));
}
$ADMIN->add('reports', new admin_externalpage(
'report_usergrades',
get_string('pluginname', 'report_usergrades'),
$CFG->wwwroot . "/report/usergrades/index.php",
'report/usergrades:view'
));