Skip to content

Commit

Permalink
Prevent dynamic property access on classes for PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Oct 10, 2023
1 parent 2a34021 commit 090bdd5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions workflowoverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand All @@ -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;
Expand Down

0 comments on commit 090bdd5

Please sign in to comment.