From 9c58581fb124dcfc1b18d04cddabbf30833cd809 Mon Sep 17 00:00:00 2001 From: Aron <35692938+TheRealAjay@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:09:02 +0200 Subject: [PATCH] removed Upload type from setUpload - for Injections When Injecting "SilverStripe\Assets\Upload" with a custom class, the UploadReceiver.php trait throws an "Uncaught TypeError", at setUpload(). This is happening due to the "Upload" type defined in docblocks and params. Removing this type allows the Upload Class to be properly injected. --- src/Forms/UploadReceiver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forms/UploadReceiver.php b/src/Forms/UploadReceiver.php index 50eac94e305..3e6d23369f4 100644 --- a/src/Forms/UploadReceiver.php +++ b/src/Forms/UploadReceiver.php @@ -61,10 +61,10 @@ public function getUpload() /** * Sets the upload handler * - * @param Upload $upload + * @param $upload * @return $this Self reference */ - public function setUpload(Upload $upload) + public function setUpload($upload) { $this->upload = $upload; return $this;