You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The loadCoreComponent function has to fail if dirroot is not set. First a new empty class is created, the next step evaluates the dirroot of this (empty) class. (/codechecker/moodle/Util/MoodleUtil.php)
if (!isset($CFG->dirroot)) { // No defined, let's start from scratch.
$CFG = new \stdClass();
}
if ($CFG->dirroot !== $moodleRoot) { // Different, set the minimum required.
We need to revisit that "illogical" code (just noting that, normally it uses to be set, but should work if not, too).
Thanks for the report!
Ciao :-)
The text was updated successfully, but these errors were encountered:
In order to use the core_component functions, sensible defaults are
required.
These sensible defaults are available, but the check of `$CFG->dirroot`
when $CFG is empty lead to a php warning, causing phpcs failures.
Even if this error is fixed, the default values in $CFG are then set to
NULL after including core_component, which means that uses of it work
with null values and cause require errors.
Fixesmoodlehq#184
Form @ewallah, in recently fixed #179 (PR #183):
The loadCoreComponent function has to fail if dirroot is not set. First a new empty class is created, the next step evaluates the dirroot of this (empty) class. (/codechecker/moodle/Util/MoodleUtil.php)
We need to revisit that "illogical" code (just noting that, normally it uses to be set, but should work if not, too).
Thanks for the report!
Ciao :-)
The text was updated successfully, but these errors were encountered: