Exception - Call to undefined function get_mimetypes_array()

Exception - Call to undefined function get_mimetypes_array()

by Thomas College -
Number of replies: 1

We recently received the following error when attempting to open two different student submissions in a class assignment.  The student submissions that were uploaded were MS Word documents (.docx format).  The other Word documents that were uploaded to the assignment do not have this problem.  Has anyone experienced this problem before, or have any insight on how fix it?  Our current environment is: 

Moodle 3.4.2, MS Windows Server 2016, SQL Server 2014, PHP 7.1

The full developer debug error we receive is:

Exception - Call to undefined function get_mimetypes_array()

Debug info:
Error code: generalexceptionmessage
Stack trace:
  • line 999 of \lib\moodlelib.php: Error thrown
  • line 1022 of \lib\moodlelib.php: call to clean_param()
  • line 1001 of \lib\setuplib.php: call to clean_param()
  • line 839 of \lib\setuplib.php: call to setup_get_remote_url()
  • line 734 of \lib\setup.php: call to initialise_fullme()
  • line 39 of \config.php: call to require_once()
  • line 30 of \pluginfile.php: call to require_once()


Average of ratings: -
In reply to Thomas College

Re: Exception - Call to undefined function get_mimetypes_array()

by Thomas College -

I believe we have found the cause of the issue.  This seems to occur when the document's file name is more than 90 characters, including spaces and the file extension.  Files with 90 characters work properly, but those with 91 characters do not.  I've created MDL-62324 to report this issue as a bug.

Thanks