Error when editing a section on PHP 8.0 on Moodle 4.0
Issue #117
resolved
The following error is generated when trying to edit a section using the tiles course format on PHP 8.0
(It may be related to https://php.watch/versions/8.0/named-parameters )
Exception - Unknown named parameter $
More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:
- line 947 of /course/format/classes/base.php: Error thrown
- line 947 of /course/format/classes/base.php: call to call_user_func_array()
- line 682 of /course/format/tiles/lib.php: call to core_courseformat\base->create_edit_form_elements()
- line 47 of /course/editsection_form.php: call to format_tiles->create_edit_form_elements()
- line 214 of /lib/formslib.php: call to editsection_form->definition()
- line 1166 of /course/format/classes/base.php: call to moodleform->__construct()
- line 104 of /course/editsection.php: call to core_courseformat\base->editsection_form()
Comments (5)
-
reporter -
It works! Thanks.
-
repo owner - changed status to resolved
Thanks for the report and investigation. Fixed in current Beta
-
This Bug is only related to PHP 8.0. Please also backport it to the 3.11 branch.
-
@David Watson Any chance that we get an updated Version of the 3.9-3.11 Branch as per Ben’s request? PHP-Versions older than PHP 8.0 are EOL as of last November, which adds pressure to switch to PHP8 even on older moodle Versions.
- Log in to comment
The fix seems to be to modify line 634 of lib.php from:
https://bitbucket.org/dw8/moodle-format_tiles/src/704ef6d037117f41f9fa954bb302879cb8354fda/lib.php#lines-634
'element_attributes' => array('' => '')
to
'element_attributes' => array(array('' => ''))