Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.1, 3.1.3, 3.2
-
Component/s: Other
-
Labels:
-
Database:MySQL
-
Testing Instructions:
-
Workaround:
-
Affected Branches:MOODLE_31_STABLE, MOODLE_32_STABLE
-
Fixed Branches:MOODLE_31_STABLE, MOODLE_32_STABLE
-
Pull from Repository:
-
Pull Master Branch:wip-
MDL-56642-master -
Pull Master Diff URL:
Description
My issue with downloading excel or ods file of statistics of Offline Quiz in Moodle 3.1.2.
When I select the statistics report in Excel or ODS format to download, it fails. The error
in the console is:
GETHTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier).
All other formats appear to be working correctly however.
The error log file of php found this:
[28-Oct-2016 16:37:35 Etc/GMT-8] Default exception handler: Exception - RecursiveDirectoryIterator::__construct(C:\Windows\TEMP/ods58130e4f1795c,C:\Windows\TEMP/ods58130e4f1795c): Access is denied. (code: 5) Debug:
Error code: generalexceptionmessage
- line 152 of \lib\spout\src\Spout\Writer\Common\Helper\ZipHelper.php: UnexpectedValueException thrown
- line 152 of \lib\spout\src\Spout\Writer\Common\Helper\ZipHelper.php: call to RecursiveDirectoryIterator->__construct()
- line 273 of \lib\spout\src\Spout\Writer\ODS\Helper\FileSystemHelper.php: call to Box\Spout\Writer\Common\Helper\ZipHelper->addFolderToArchive()
- line 104 of \lib\spout\src\Spout\Writer\ODS\Internal\Workbook.php: call to Box\Spout\Writer\ODS\Helper\FileSystemHelper->zipRootFolderAndCopyToStream()
- line 90 of \lib\spout\src\Spout\Writer\ODS\Writer.php: call to Box\Spout\Writer\ODS\Internal\Workbook->close()
- line 331 of \lib\spout\src\Spout\Writer\AbstractWriter.php: call to Box\Spout\Writer\ODS\Writer->closeWriter()
- line 99 of \lib\classes\dataformat\spout_base.php: call to Box\Spout\Writer\AbstractWriter->close()
- line 1770 of \lib\tablelib.php: call to core\dataformat\spout_base->write_footer()
- line 951 of \mod\offlinequiz\report\statistics\report.php: call to table_dataformat_export_format->finish_table()
- line 301 of \mod\offlinequiz\report\statistics\report.php: call to offlinequiz_statistics_report->download_offlinequiz_info_table()
- line 107 of \mod\offlinequiz\report.php: call to offlinequiz_statistics_report->display()
Same problem occured in feedback module.
https://moodle.org/mod/forum/discuss.php?d=336437
I traced source codes of Spout module. I found Spout used sys_get_temp_dir() php builtin function. Windows system default temp directory
is C:\Windows\temp. PHP process lacked list folder permissions in temp directory, so occurred RecursiveDirectoryIterator executing error.