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: check subject earlier before ExApp check #252

Merged
merged 2 commits into from
Mar 20, 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.3.2 - 2024-03-xx]

### Fixed

- Fixed incorrect notifications handling producing a lot of errors in the log. #252

## [2.3.1 - 2024-03-18]

## Added
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to join us in shaping a more versatile, stable, and secure app landscape.
*Your insights, suggestions, and contributions are invaluable to us.*

]]></description>
<version>2.3.1</version>
<version>2.3.2</version>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand Down
7 changes: 4 additions & 3 deletions lib/Notifications/ExAppAdminNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ public function getName(): string {
}

public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getSubject() !== 'ex_app_version_update') {
throw new InvalidArgumentException();
}
$exApp = $this->service->getExApp($notification->getApp());
// TODO: Think about another possible admin ExApp notifications, make them unified
// TODO: Think about ExApp rich objects
if ($exApp === null || $notification->getSubject() !== 'ex_app_version_update') {
if ($exApp === null) {
throw new InvalidArgumentException();
}
if ($exApp->getEnabled()) {
Expand Down
Loading