From 16c3da1ae11dff749352997786b170b1536de91e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 20 Jun 2024 10:34:50 +0200 Subject: [PATCH] Set all File props first before running ::setContent and ::setTranslations --- src/Cms/File.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cms/File.php b/src/Cms/File.php index 0c21e79c64..a5334e771f 100644 --- a/src/Cms/File.php +++ b/src/Cms/File.php @@ -81,8 +81,6 @@ class File extends ModelWithContent */ public function __construct(array $props) { - parent::__construct($props); - if (isset($props['filename'], $props['parent']) === false) { throw new InvalidArgumentException('The filename and parent are required'); } @@ -95,6 +93,8 @@ public function __construct(array $props) $this->root = null; $this->url = $props['url'] ?? null; + parent::__construct($props); + $this->setBlueprint($props['blueprint'] ?? null); }