Skip to content

Commit f3f924a

Browse files
committed
MDL-86170: use get_custom_rules in get_available_custom_rules
The call to $this->cm->customdata in activity_custom_completion::get_available_custom_rules can sometimes lead to a recursion in __get() which then throws the error “Cannot access private property cm_info::$customdata”. This should use the direct get_custom_data method instead.
1 parent 26a8e00 commit f3f924a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

public/completion/classes/activity_custom_completion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function is_available(string $rule): bool {
101101
public function get_available_custom_rules(): array {
102102
$rules = static::get_defined_custom_rules();
103103
$availablerules = [];
104-
$customdata = (array)$this->cm->customdata;
104+
$customdata = (array)$this->cm->get_custom_data();
105105
foreach ($rules as $rule) {
106106
$customrule = $customdata['customcompletionrules'][$rule] ?? false;
107107
if (!empty($customrule)) {

0 commit comments

Comments
 (0)