maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

iss-1120 - Fix restore of old questions causing all restores to fail #1126

Closed EJMFarrow closed 3 months ago

EJMFarrow commented 4 months ago

I think this was triggered by an attempt to restore a really old and/or broken STACK question that was missing some fields. Previously with PHP 7, blank string fields would have been evaluated to 0 when attempting to perform maths but PHP 8 is more picky so the tidy up after importing such a question now fails. That tidy up is run on all restores so it keeps failing.

Casting to int forces evaluation to 0 and reinstates the old behaviour.