moodle-mod_simplecertificate
moodle-mod_simplecertificate copied to clipboard
3.9 version ( 2020041239 ) cannot write files
Describe the bug I would really like to continue using Simple Certificate with Moodle 4.0 so I tried to install and knew it would probably have problems but I want to report - hoping I might get some insight on fixing it for M4.x
In essence, it all installs and is configurable, but it has trouble writing files or temp file I believe: Error code: storedfilenotcreated
Moodle Version(s) Moodle 4.0 (Build: 20220419) - PHP 7.4 - MySQL 8.0
To Reproduce Steps to reproduce the behavior:
- Install version for moodle 3.9 from github branch - on a fresh Moodle 4.0 instance
- Create example Simple Certificate activity
- Try to view from "Issue a test certificate" tab - click Get Certificate
- Here is the debug info from Moodle :
Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
More information about this error
×Debug info: Object of class stored_file could not be converted to string Error code: codingerror ×Stack trace: line 427 of \lib\setuplib.php: coding_exception thrown line 2315 of \lib\filelib.php: call to default_error_handler() line 2602 of \lib\filelib.php: call to readfile_accel() line 2756 of \lib\filelib.php: call to send_file() line 1325 of \mod\simplecertificate\locallib.php: call to send_stored_file() line 1911 of \mod\simplecertificate\locallib.php: call to simplecertificate->output_pdf() line 122 of \mod\simplecertificate\view.php: call to simplecertificate->view_default()
Expected behavior Open a PDF certificate in a pop-up window.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Windows
- Chrome
Additional context Add any other context about the problem here.
Tracing back the error stack, it seems that moodle's debbugger is throwing an error 'cause is not possible to generate a file and show it in the same call (buffer error).
Disabling the debug messages in "/admin/settings.php?section=debugging" seems to avoid this problem.
This issue is complicated by the code to the handle errors in readfile_accel() containing an error, see MDL-72582. The Object of class stored_file could not be converted to string message is this second error within Moodle, not the error causing the problem.