Skip to content

Commit

Permalink
MDL-60319 Google converter: Add html to convertible types
Browse files Browse the repository at this point in the history
Add html files to the file types that Google can convert. This allows
the Google Drive converter to convert online submissions to pdf. This
fixes an issue where if online submissions is selected and the Google
Drive converter is used all conversions fail and produce a single
blank pdf. Credit to Peter Svec for the idea for this fix.
  • Loading branch information
mspall committed Oct 5, 2017
1 parent 23ab0d7 commit 151138a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions files/converter/googledrive/classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class converter implements \core_files\converter_interface {
'xls' => 'application/vnd.google-apps.spreadsheet',
'xlsx' => 'application/vnd.google-apps.spreadsheet',
'ppt' => 'application/vnd.google-apps.presentation',
'pptx' => 'application/vnd.google-apps.presentation'
'pptx' => 'application/vnd.google-apps.presentation',
'html' => 'application/vnd.google-apps.document'
];

/** @var array $export List of supported export file formats */
Expand Down Expand Up @@ -265,6 +266,6 @@ public static function supports($from, $to) {
* @return string
*/
public function get_supported_conversions() {
return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf']);
return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf', 'html']);
}
}

0 comments on commit 151138a

Please sign in to comment.