MDL-44822 assignfeedback_editpdf: Stop test generation in is_enabled()
This change also moves one of the checks in test_gs_path. If generateimage is false, there's no need to stat for the fixture file.
This commit is contained in:
@@ -546,13 +546,13 @@ class pdf extends \FPDI {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$testfile = $CFG->dirroot.'/mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf';
|
||||
if (!file_exists($testfile)) {
|
||||
$ret->status = self::GSPATH_NOTESTFILE;
|
||||
if (!$generateimage) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (!$generateimage) {
|
||||
$testfile = $CFG->dirroot.'/mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf';
|
||||
if (!file_exists($testfile)) {
|
||||
$ret->status = self::GSPATH_NOTESTFILE;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ class assign_feedback_editpdf extends assign_feedback_plugin {
|
||||
* @return bool
|
||||
*/
|
||||
public function is_enabled() {
|
||||
$testpath = assignfeedback_editpdf\pdf::test_gs_path();
|
||||
$testpath = assignfeedback_editpdf\pdf::test_gs_path(false);
|
||||
if (!extension_loaded('zlib')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user