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

Php 8.2 deprecation warnings populating explanation boxes for multiple choices answers #417

Open
lectrical opened this issue Jan 2, 2024 · 3 comments

Comments

@lectrical
Copy link

lectrical commented Jan 2, 2024

Describe the bug

Running on a Debian Bookworm server with nginx 1.22.1 and php-fpm 8.2. I kept seeing depreciated warnings that were visible in the rendering of the page. I believe these were mostly resolved with the use of this in my php.ini

error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT & ~E_NOTICE

This resolved me seeing the following explanation box warnings showing as the explanation on this the list page.

It did not fix the main annoyance of the error being automatically generated into the explanation box for multiple choice questions.

image

Every new answer will have this warning automatically entered into the explanation box until i manually enter some text. Without the php.ini settings it will also be visible in the list section as the text of the explanation.

Note

By following this https://stackoverflow.com/a/71719307 and doing this for all instances of htmlspecialchars in the /admin/code/tce_edit_answer.php and /admin/code/tce_edit_question.php I was able to prevent the warning from populating the explanation box

   echo '>' . htmlspecialchars($answer_explanation ?? '', ENT_NOQUOTES, $l['a_meta_charset']) . '</textarea>' . K_NEWLINE;

I don't assume this is an elegant solution because it's not solving the problem of why the text is populated into that box in the first place but resolving the deprecation warnings which is effectively masking the bug and lets me carry on in the meantime.

To Reproduce
Steps to reproduce the behavior:

Install tcexam on linux/debian bookworm with nginx 1.22.1 and php-fpm 8.2

Expected behavior

Not have the answer explanation box text auto populated with the depreciation warning.

Logs

I figure this is not so helpful as we know the warnings are valid, it's just not meant to populate that box?

Environment:

  • OS: Linux
  • Version: debian bookworm

Additional context
Add any other context about the problem here.

@nicolaasuni
Copy link
Member

Are you using the latest TCExam version?

@lectrical
Copy link
Author

@nicolaasuni I git cloned the repo and as there is only a main branch/no releases would say yes, that is the current source?

git clone https://github.com/tecnickcom/tcexam.git

Also, still see some warnings in the UI, like tce_edit_user.php but not others.

@PepeProgrammingHub
Copy link

PepeProgrammingHub commented Jan 3, 2024 via email

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