Lesterhuis-Training-en-Consultancy / moodle-block_configurable_reports

This block is a Moodle custom reports builder. You can create custom reports without SQL knowledge. It's a tool suitable for admins or teachers.
http://moodle.org/plugins/view.php?plugin=block_configurable_reports
1 stars 0 forks source link

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

Open calbasi opened 6 months ago

calbasi commented 6 months ago

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 commented 5 months ago

@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 commented 3 months ago

@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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

@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 commented 2 months ago

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.

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.