-
Bug
-
Resolution: Fixed
-
Minor
-
3.2 regressions, 3.3, 3.4
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-60443_dataformat_lib_wrong_variable -
When a required dataformat doesn't exist, the next error is showed:
Undefined variable: type in /<moodle-path>/lib/dataformatlib.php
It is a small developer bug and affect developers principally.
The error occurred because the variable name is wrong, the variable $type really is $dataformat.
To reproduce:
0. Set "Debug messages" to "Developer" and "Display debug messages" to "Yes".
1. Go to "Bulk user actions" and select users
2. From "With selected users..." select "Download" and "Go"
3. In the URL, add the parameter "dataformat" equal to "xls"
Something like: http://<moodle-host>/admin/user/user_bulk_download.php?dataformat=xls
If replace xls by csv the error not happen, the download is successfull.
Something like: http://<moodle-host>/admin/user/user_bulk_download.php?dataformat=csv
4. The error is printed in the page.
Note: the error can be hide below the main bar.
5. The message "Coding error detected, it must be fixed by a programmer: Unable to locate dataformat//classes/writer.php" is incomplete.
The solution is easy, change this line:
throw new coding_exception("Unable to locate dataformat/$type/classes/writer.php"); |
By this line
throw new coding_exception("Unable to locate dataformat/$dataformat/classes/writer.php"); |
into lib/dataformatlib.php, function download_as_dataformat.