Open mhughes2k opened 1 year ago
Deprecated: Required parameter $contextlevel follows optional parameter $instanceid in /var/www/html/local/metadata/lib.php on line 68
Running on Moodle 4.x (master) and PHP 8.0.
Function's signature is function local_metadata_definition($mform, $instanceid = 0, $contextlevel)
function local_metadata_definition($mform, $instanceid = 0, $contextlevel)
But needs to either become:
1) function local_metadata_definition($mform, $contextlevel, $instanceid = 0)
function local_metadata_definition($mform, $contextlevel, $instanceid = 0)
2) function local_metadata_definition($mform, $instanceid = 0, $contextlevel = null)
function local_metadata_definition($mform, $instanceid = 0, $contextlevel = null)
3) function local_metadata_definition($mform, $instanceid, $contextlevel)
function local_metadata_definition($mform, $instanceid, $contextlevel)
(1) "breaks" existing calls by fixing the order of required / optional parameters.
(2) keeps existing calls working but will require an extra validation set to do something in the case that $contextlevel is not passed.
(3) removes the optionality of $instanceid
I think that (1) is the correct option as it's inline with what I believe is the sentiment of making a minimal call to this...
I did just notice that the function local_metadata_definition_after_data($mform, $instanceid, $contextlevel) has no optionals, so maybe this is more the right way to update?
function local_metadata_definition_after_data($mform, $instanceid, $contextlevel)
Deprecated: Required parameter $contextlevel follows optional parameter $instanceid in /var/www/html/local/metadata/lib.php on line 68
Running on Moodle 4.x (master) and PHP 8.0.
Function's signature is
function local_metadata_definition($mform, $instanceid = 0, $contextlevel)
But needs to either become:
1)
function local_metadata_definition($mform, $contextlevel, $instanceid = 0)
2)
function local_metadata_definition($mform, $instanceid = 0, $contextlevel = null)
3)
function local_metadata_definition($mform, $instanceid, $contextlevel)
(1) "breaks" existing calls by fixing the order of required / optional parameters.
(2) keeps existing calls working but will require an extra validation set to do something in the case that $contextlevel is not passed.
(3) removes the optionality of $instanceid
I think that (1) is the correct option as it's inline with what I believe is the sentiment of making a minimal call to this...