From ed0913d45b4004b8407ffef572e0806930678fbc Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 13 Jun 2022 12:27:57 +0200 Subject: [PATCH] MDL-74358 availability: Avoid php8 problem with array_values(null) --- availability/classes/tree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/availability/classes/tree.php b/availability/classes/tree.php index d88cf3a14c3..6f5d08b3711 100644 --- a/availability/classes/tree.php +++ b/availability/classes/tree.php @@ -684,7 +684,7 @@ class tree extends tree_node { } else { unset($this->children[$index]); unset($this->showchildren[$index]); - $this->showchildren = array_values($this->showchildren); + $this->showchildren = !is_null($this->showchildren) ? array_values($this->showchildren) : null; $changed = true; } }