From 9b97b5f95b3adbf3946e9410a079fea6220068c7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:58:09 +1300 Subject: [PATCH] FIX Don't use call_user_func_array in __call() (#3034) --- code/Model/VirtualPage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/Model/VirtualPage.php b/code/Model/VirtualPage.php index cfbc2c6a82..a734c2bc0d 100644 --- a/code/Model/VirtualPage.php +++ b/code/Model/VirtualPage.php @@ -483,10 +483,11 @@ public function isFieldVirtualised($field) */ public function __call($method, $args) { - if (parent::hasMethod($method)) { + if (parent::hasMethod($method) || !$this->CopyContentFromID) { return parent::__call($method, $args); } else { - return call_user_func_array([$this->CopyContentFrom(), $method], $args ?? []); + $record = $this->CopyContentFrom(); + return $record->$method(...$args); } }