Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #87 - Correct return type #88

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Guest Entries

## Unreleased

### Fixed
- Fixed a PHP error that could occur on validation failure. ([#87](https://github.com/craftcms/guest-entries/issues/87))

## 4.0.0 - 2024-03-19

- Added Craft 5 compatibility.
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private function _returnSuccess(Entry $entry, $isSpam = false): Response
*
* @param Settings $settings
* @param Entry $entry
* @return Response
* @return Response|null
*/
private function _returnError(Settings $settings, Entry $entry): Response
private function _returnError(Settings $settings, Entry $entry): ?Response
{
if ($this->hasEventHandlers(self::EVENT_AFTER_ERROR)) {
$this->trigger(self::EVENT_AFTER_ERROR, new SaveEvent([
Expand Down
Loading