Commit 3f8b0320 authored by joseph.olstad's avatar joseph.olstad Committed by olstjos

Issue #2889393 by joseph.olstad, alisonjo2786: Call to undefined function...

Issue #2889393 by joseph.olstad, alisonjo2786: Call to undefined function file_entity_get_filetype_candidates()
parent e3a0fa53
......@@ -1138,6 +1138,9 @@ function media_get_thumbnail_preview($file, $link = FALSE, $view_mode = 'preview
function media_file_validate_types($file, $types) {
$errors = array();
if (!function_exists('file_entity_get_filetype_candidates')) {
module_load_include('inc', 'file_entity', 'file_entity.pages');
}
$file_candidates = array_keys(file_entity_get_filetype_candidates($file));
if (!array_intersect($file_candidates, $types)) {
$errors[] = t('Only the following types of files are allowed to be uploaded: %types-allowed', array('%types-allowed' => implode(', ', $types)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment