Skip to content

Commit 6254227

Browse files
authored
Merge pull request #167 from craftcms/fix-#165
Fix #165
2 parents cf89487 + 02efc2c commit 6254227

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release Notes for Element API
22

3+
## Unreleased
4+
- Fix an issue where `EVENT_BEFORE_SEND_DATA` wasn't returning data. ([#165](https://github.com/craftcms/element-api/issues/165))
5+
36
## 3.0.0 - 2022-05-03
47

58
### Added

src/DataEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ class DataEvent extends Event
1616
/**
1717
* @var Scope The Fractal data associated with the event
1818
*/
19-
public $data;
19+
public Scope $payload;
2020
}

src/controllers/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function actionIndex(string $pattern): Response
175175
// Fire a 'beforeSendData' event
176176
if ($this->hasEventHandlers(self::EVENT_BEFORE_SEND_DATA)) {
177177
$this->trigger(self::EVENT_BEFORE_SEND_DATA, new DataEvent([
178-
'data' => $data,
178+
'payload' => $data,
179179
]));
180180
}
181181

0 commit comments

Comments
 (0)