Allow empty space invite with empty originator (#5906)

* Allow empty space invite with empty originator

* Update CHANGELOG.md
This commit is contained in:
Lucas Bartholemy 2022-11-11 10:32:31 +01:00 committed by GitHub
parent d85be4d684
commit f0c70874f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,7 @@ HumHub Changelog
- Fix #5877: Fix wrong empty profile stream message
- Fix #5874: Fix adding licence key after removing it from marketplace
- Enh #5891: Improve select2 width on people filters
- Enh #5906: Allow Space Invites with empty originator
- Fix #5909: Fix optional parameter on ldap user searching
1.12.1 (August 15, 2022)

View File

@ -425,9 +425,13 @@ class SpaceModelMembership extends Behavior
$userInvite = Invite::findOne(['email' => $user->email]);
if ($userInvite !== null && $userInvite->source == Invite::SOURCE_INVITE && !$silent) {
InviteAccepted::instance()->from($user)->about($this->owner)
->send(User::findOne(['id' => $userInvite->user_originator_id]));
if ($userInvite !== null &&
!empty($userInvite->user_originator_id) &&
$userInvite->source == Invite::SOURCE_INVITE && !$silent) {
$originator = User::findOne(['id' => $userInvite->user_originator_id]);
if ($originator !== null) {
InviteAccepted::instance()->from($user)->about($this->owner)->send($originator);
}
}
} else {
// User is already member