Skip to content

Commit

Permalink
Merge pull request #14641 from craftcms/bugfix/14635-recent-activity-…
Browse files Browse the repository at this point in the history
…element-as-a-response

recent activity element can be a response
  • Loading branch information
brandonkelly authored Mar 22, 2024
2 parents 9d1f891 + a518fa6 commit 0ee238c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions src/controllers/ElementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down

0 comments on commit 0ee238c

Please sign in to comment.