Merge branch 'wip-mdl-42222' of git://github.com/rajeshtaneja/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 9 Oct 2013 09:23:44 +0000 (17:23 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 9 Oct 2013 09:23:44 +0000 (17:23 +0800)
mod/assign/feedback/editpdf/classes/document_services.php
mod/assign/feedback/editpdf/tests/editpdf_test.php

index e956208..9fe930a 100644 (file)
@@ -117,7 +117,7 @@ class document_services {
             if ($plugin->is_enabled() && $plugin->is_visible()) {
                 $pluginfiles = $plugin->get_files($submission, $user);
                 foreach ($pluginfiles as $filename => $file) {
-                    if ($file->get_mimetype() === 'application/pdf') {
+                    if (($file instanceof \stored_file) && ($file->get_mimetype() === 'application/pdf')) {
                         $files[$filename] = $file;
                     }
                 }
index 1e64c5e..6afe93f 100644 (file)
@@ -54,7 +54,8 @@ class assignfeedback_editpdf_testcase extends mod_assign_base_testcase {
 
     protected function create_assign_and_submit_pdf() {
         global $CFG;
-        $assign = $this->create_instance(array('assignsubmission_file_enabled' => 1,
+        $assign = $this->create_instance(array('assignsubmission_onlinetext_enabled' => 1,
+                                               'assignsubmission_file_enabled' => 1,
                                                'assignsubmission_file_maxfiles' => 1,
                                                'assignfeedback_editpdf_enabled' => 1,
                                                'assignsubmission_file_maxsizebytes' => 1000000));