Skip to content

Plugin: Test2Pdf: Fix HTTP 500 when exporting a test with a description - refs #2641 - #9490

Open
ybtbeez wants to merge 1 commit into
chamilo:masterfrom
ybtbeez:fix/test2pdf-fiximagespaths
Open

ybtbeez wants to merge 1 commit into
chamilo:masterfrom
ybtbeez:fix/test2pdf-fiximagespaths

Conversation

@ybtbeez

@ybtbeez ybtbeez commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

PDF::fixImagesPaths() still assumed the 1.11 course layout and read $courseInfo['path'], which Chamilo 2 course info no longer has. With the dev error handler this turned every Test2Pdf export of a test or question that has a description into a fatal error.

Only use the legacy app/courses//document/ rewriting when the course info actually has a path, and inline images served by Chamilo 2 resource URLs (/r/{tool}/{type}/{uuid}/view) as data URIs after a ResourceNodeVoter VIEW check, since mPDF cannot fetch them without the user's session.

…on - refs chamilo#2641

PDF::fixImagesPaths() still assumed the 1.11 course layout and read
$courseInfo['path'], which Chamilo 2 course info no longer has. With the
dev error handler this turned every Test2Pdf export of a test or question
that has a description into a fatal error.

Only use the legacy app/courses/<path>/document/ rewriting when the course
info actually has a path, and inline images served by Chamilo 2 resource
URLs (/r/{tool}/{type}/{uuid}/view) as data URIs after a ResourceNodeVoter
VIEW check, since mPDF cannot fetch them without the user's session.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant