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

WSOD on php 8.0 or 8.1 using more than 1 condition #4

Open
calbasi opened this issue May 22, 2024 · 6 comments
Open

WSOD on php 8.0 or 8.1 using more than 1 condition #4

calbasi opened this issue May 22, 2024 · 6 comments
Assignees

Comments

@calbasi
Copy link

calbasi commented May 22, 2024

Hi, just updated my module to version 4.1, and I get a WSOD (white screen of dead) on my configurable report results page. I have not any log in my error.log and no errors are shown if I enable Moodle debug option.

It happens when I use 2 conditions (so I have to use a logical operator, like AND or OR).

When I use no conditions or just 1 condition, it's all right.

By the way, I'm using a "users report" type.

@gemguardian gemguardian self-assigned this Jul 5, 2024
@gemguardian
Copy link
Member

@calbasi thank you for reporting this issue. Could you please provided more ifnormation like your PHP and SQL version, and the JSON export.

That said - please be aware that we don't have any funding left to continue fixing issues in this module. If you are interested in funding the necessary fix please let us know.

@gemguardian gemguardian assigned calbasi and unassigned gemguardian Aug 9, 2024
@gemguardian
Copy link
Member

@calbasi Though I would ping you just to be sure if you could provided us the following information:

  1. PHP version
  2. SQL version/database use
  3. an JSON/XML or TXT export of the report you are trying to get working

@calbasi
Copy link
Author

calbasi commented Aug 11, 2024

Estado de finalización por curso y unidad de negocio.xml.txt

@calbasi Though I would ping you just to be sure if you could provided us the following information:

Sorry for the delay! :-)

1. PHP version

Using Debian Stable and sury repos to have different php versions. For example:

PHP 8.2.22 (cli) (built: Aug 2 2024 16:01:44) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.22, Copyright (c) Zend Technologies
with Zend OPcache v8.2.22, Copyright (c), by Zend Technologies

2. SQL version/database use

mysql Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

3. an JSON/XML or TXT export of the report you are trying to get working

Not sure if I have the xml file you need, but I'm attaching it to you:

`

`

Edit: attaching now just changing file extension name and commenting the first xml line

@calbasi
Copy link
Author

calbasi commented Aug 11, 2024

That said - please be aware that we don't have any funding left to continue fixing issues in this module. If you are interested in funding the necessary fix please let us know.

It depends on :-) I can have some (not much) funds if we were lucky and it is an easy bug. I could help you to try to fix it if you provide me with guidance/support for debug, etc.

@gemguardian
Copy link
Member

@calbasi I could reproduce the issue but I am not sure if it is caused by any changes on our side.

If you provided a patch we surely would take a look at it.

@jupedega
Copy link

I have had the same problem. The problem is caused by this EvalWise class that extends EvalMath, when calling public function pfx($tokens, array $vars = []). Since the update to PHP 8, it is more strict with type inheritance.

  • Type inheritance: When one class inherits from another, the types of the parameters and the return values ​​of the methods must match exactly. If they do not match, a fatal error will be thrown.

The problem is that EvalMath expects public function pfx($tokens, $vars = []) instead of public function pfx($tokens, array $vars = []), precisely because of type inheritance. It is only necessary to change line 62 of the file from evalwise.class.php public function pfx($tokens, array $vars = []) to public function pfx($tokens, $vars = []). This would solve the error and allow you to chain the conditionals.

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