MDL-61194 assignfeedback_editpdf: Check if we can convert online text
authorCameron Ball <cameron@moodle.com>
Thu, 11 Jan 2018 08:38:00 +0000 (16:38 +0800)
committerCameron Ball <cameron@moodle.com>
Thu, 3 May 2018 08:44:27 +0000 (16:44 +0800)
This patch adds a check to make sure there is a converter available that
will be able to handle html->pdf conversion before adding onlinetext
submissions to the list of files to combine.

mod/assign/feedback/editpdf/classes/document_services.php

index 0920bbc..fa6dbfb 100644 (file)
@@ -188,7 +188,7 @@ EOD;
                         } else if ($convertedfile = $converter->start_conversion($file, 'pdf')) {
                             $files[$filename] = $convertedfile;
                         }
-                    } else {
+                    } else if ($converter->can_convert_format_to('html', 'pdf')) {
                         // Create a tmp stored_file from this html string.
                         $file = reset($file);
                         // Strip image tags, because they will not be resolvable.