diff --git a/CHANGELOG.md b/CHANGELOG.md index 1392da4a867..e6ce689efd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - The `setup/cloud` command now ensures that the environment and `composer.json` are configured to use PHP 8.1+. - Fixed a JavaScript error that could occur if another error occurred when performing an element action. - Fixed a bug where filesystems’ `afterSave()` and `afterDelete()` methods weren’t getting called. ([#14634](https://github.com/craftcms/cms/pull/14634)) +- Fixed an error that could occur on `elements/recent-activity` Ajax requests when editing an element. ([#14635](https://github.com/craftcms/cms/issues/14635)) ## 4.8.4 - 2024-03-19 diff --git a/src/controllers/ElementsController.php b/src/controllers/ElementsController.php index 3d7870bbd77..9ad6d41b9a2 100644 --- a/src/controllers/ElementsController.php +++ b/src/controllers/ElementsController.php @@ -1787,6 +1787,10 @@ public function actionRecentActivity(): Response { $element = $this->_element(); + if ($element instanceof Response) { + return $element; + } + if (!$element || $element->getIsRevision()) { throw new BadRequestHttpException('No element was identified by the request.'); }