diff --git a/src/controllers/CkeditorController.php b/src/controllers/CkeditorController.php index c7d5df97..ee27aeaf 100644 --- a/src/controllers/CkeditorController.php +++ b/src/controllers/CkeditorController.php @@ -86,7 +86,7 @@ public function actionEntryCardHtml(): Response { $entryId = $this->request->getRequiredBodyParam('entryId'); $siteId = $this->request->getBodyParam('siteId'); - $layoutElementUid = $this->request->getBodyParam('layoutElementUid'); + $layoutElementUid = $this->request->getRequiredBodyParam('layoutElementUid'); // it's okay to limit to provided siteId, as we're "just" after the card html; // all the hard work has already been done @@ -100,6 +100,11 @@ public function actionEntryCardHtml(): Response } $owner = $entry->getOwner(); + + if (!$owner) { + throw new BadRequestHttpException("Invalid entry owner"); + } + /** @var CustomField $layoutElement */ $layoutElement = $owner->getFieldLayout()->getElementByUid($layoutElementUid); /** @var Field $field */