MDL-60443 dataformat lib: Change a wrong variable name
authorDavid Herney <davidherney@gmail.com>
Tue, 28 Nov 2017 01:15:30 +0000 (20:15 -0500)
committerJun Pataleta <jun@moodle.com>
Wed, 6 Dec 2017 06:53:34 +0000 (19:53 +1300)
The variable $type really is $dataformat. I have changed it for
prevent the error and show a correct error message.

lib/dataformatlib.php

index fad18d6..4412e96 100644 (file)
@@ -44,7 +44,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca
 
     $classname = 'dataformat_' . $dataformat . '\writer';
     if (!class_exists($classname)) {
-        throw new coding_exception("Unable to locate dataformat/$type/classes/writer.php");
+        throw new coding_exception("Unable to locate dataformat/$dataformat/classes/writer.php");
     }
     $format = new $classname;