From 090bdd567a53ce0d513a747b47ef47edb4ed30a1 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Tue, 10 Oct 2023 09:07:32 +0200 Subject: [PATCH] Prevent dynamic property access on classes for PHP 8.2 --- workflowoverview.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflowoverview.php b/workflowoverview.php index f89e0afd..41b7c735 100644 --- a/workflowoverview.php +++ b/workflowoverview.php @@ -102,6 +102,7 @@ // Mustache cannot handle arrays which have other keys therefore a new array is build. // FUTURE: Nice to have Icon for each subplugin. + $trigger = (object)(array) $trigger; // Cast to normal object to be able to set dynamic properties. $actionmenu = new action_menu([ new action_menu_link_secondary( new moodle_url(urls::EDIT_ELEMENT, ['type' => settings_type::TRIGGER, 'elementid' => $trigger->id]), @@ -126,6 +127,7 @@ } foreach ($steps as $step) { + $step = (object)(array) $step; // Cast to normal object to be able to set dynamic properties. $ncourses = $DB->count_records('tool_lifecycle_process', array('stepindex' => $step->sortindex, 'workflowid' => $workflowid)); $step->numberofcourses = $ncourses;