-
Bug
-
Resolution: Fixed
-
Minor
-
3.9.12, 3.10.9, 3.11.5, 3.11.7, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MDL-73876-master -
This is something that it's happening since the night of the times (if I'm not wrong) and it's certainly annoying.
For some reason, once behat detects that there is any debugging/exception message in the web page, it fails the step. And that's correct.
But it seems that there is some problem being able to get the stack trace of the debugging/exception. So you've to go to apache logs (normally) and look for it there.
For example, in apache logs... I get:
[15-Feb-2022 06:02:04 Australia/Perth] Default exception handler: Exception - Warning: A non-numeric value encountered in [dirroot]/lib/grade/grade_item.php on line 1632 Debug:
|
Error code: generalexceptionmessage
|
* line 157 of /lib/behat/lib.php: Exception thrown
|
* line 1632 of /lib/grade/grade_item.php: call to behat_error_handler()
|
* line 155 of /grade/report/singleview/classes/local/ui/finalgrade.php: call to grade_item->bounded_grade()
|
* line 356 of /grade/report/singleview/classes/local/screen/screen.php: call to gradereport_singleview\local\ui\finalgrade->set()
|
* line 389 of /grade/report/singleview/classes/local/screen/user.php: call to gradereport_singleview\local\screen\screen->process()
|
* line 56 of /grade/report/singleview/lib.php: call to gradereport_singleview\local\screen\user->process()
|
* line 124 of /grade/report/singleview/index.php: call to gradereport_singleview->process_data()
|
And, in behat output I get:
182 Scenario: I can bulk update grades. # /Users/stronk7/git_moodle/moodle/grade/report/singleview/tests/behat/singleview.feature:111
|
And I press "Save" # /Users/stronk7/git_moodle/moodle/grade/report/singleview/tests/behat/singleview.feature:117
|
Moodle exception: Exception - Warning: A non-numeric value encountered in [dirroot]/lib/grade/grade_item.php on line 1632More information about this error
|
|
Exception - Warning: A non-numeric value encountered in [dirroot]/lib/grade/grade_item.php on line 1632
|
More information about this error
|
|
|
|
×
|
|
Debug info:
|
|
Error code: generalexceptionmessage
|
(Exception)
|
And this is a paste of the HTML in the page, for reference / testing (though it's easy to throw an exception in any page and get the information):
<div class="wibbler"><div data-rel="fatalerror" class="box py-3 errorbox alert alert-danger"><p class="errormessage">Exception - Warning: A non-numeric value encountered in [dirroot]/lib/grade/grade_item.php on line 1632</p><p class="errorcode"><a href="https://docs.moodle.org/400/en/error/moodle/generalexceptionmessage">More information about this error</a></p></div><div class="alert alert-danger alert-block fade in " role="alert" data-aria-autofocus="true">
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
<strong>Debug info: </strong> <br />Error code: generalexceptionmessage
|
</div><div class="alert alert-danger alert-block fade in " role="alert" data-aria-autofocus="true">
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
<strong>Stack trace: </strong> <ul style="text-align:left;"><li>line 157 of /lib/behat/lib.php: Exception thrown</li><li>line 1632 of /lib/grade/grade_item.php: call to behat_error_handler()</li><li>line 155 of /grade/report/singleview/classes/local/ui/finalgrade.php: call to grade_item->bounded_grade()</li><li>line 356 of /grade/report/singleview/classes/local/screen/screen.php: call to gradereport_singleview\local\ui\finalgrade->set()</li><li>line 389 of /grade/report/singleview/classes/local/screen/user.php: call to gradereport_singleview\local\screen\screen->process()</li><li>line 56 of /grade/report/singleview/lib.php: call to gradereport_singleview\local\screen\user->process()</li><li>line 124 of /grade/report/singleview/index.php: call to gradereport_singleview->process_data()</li></ul>
|
</div>
|
Surely it's because we don't "parse" the html correctly (maybe it has changed and in the past it was working)... but we should try to get the correct stack trace back to behat errors output. Only that way we have both the failing scenario and the stack trace together.
Ciao