-
Bug
-
Resolution: Deferred
-
Minor
-
None
-
2.7.3, 2.8.1, 2.9
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
While working on MDL-48190 and other related issues, it was detected that the moodle_formatter is failing badly when --dry-run is used.
The main cause is that, with dry runs... CFG and friends are not available and the formatter requires it (dirroot) and, worse yet, behat_util includes a lot of stuff with way more dependencies (MOODLE_INTERNAL, and more CFG variables).
Initially I tried injecting dirrot:
'context' => array(
|
- 'class' => 'behat_init_context'
|
+ 'class' => 'behat_init_context',
|
+ 'parameters' => array(
|
+ 'dirroot' => $CFG->dirroot
|
+ ),
|
as the correct way to make the formatter aware of such dependency event-> getContextParameters(), and it worked ok but, as said, just to find that there were a lot more of dependencies there.
So, finally, thought that the best way to solve this issue, was to, simply, skip any execution of all that stuff if CFG was not set. That way dry-run simply runs ok (not that it's very useful to use such format for dry-runs, but...).
Ciao