From fe8f7eae1d74c4cb61067eda5e878eac6a6bef89 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 3 Dec 2024 14:29:02 +1300 Subject: [PATCH] FIX Don't use call_user_func_array in __call() --- 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); } }