Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.9 version ( 2020041239 ) cannot write files #256

Open
goose2000 opened this issue Jun 3, 2022 · 2 comments
Open

3.9 version ( 2020041239 ) cannot write files #256

goose2000 opened this issue Jun 3, 2022 · 2 comments

Comments

@goose2000
Copy link
Contributor

goose2000 commented Jun 3, 2022

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:

  1. Install version for moodle 3.9 from github branch - on a fresh Moodle 4.0 instance
  2. Create example Simple Certificate activity
  3. Try to view from "Issue a test certificate" tab - click Get Certificate
  4. 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.

@danko-nobre
Copy link

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.

@leonstr
Copy link

leonstr commented Jan 26, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants