Skip to content
Closed
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
3 changes: 3 additions & 0 deletions lib/Repair/ResetEmails.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function run(IOutput $output) {

foreach ($this->guestManager->listGuests() as $guestId) {
$guest = $this->userManager->get($guestId);
if ($guest === null) {
continue;
Comment on lines +42 to +43

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the guest get deleted as well, if this case is detected? I don't know anything about this app, but find it a bit strange that there can be a guest without a user. I assume this happens when the user is deleted? Please provide a little more insight here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are asking the guests manager for a list of guests and then obtaining the user object from the user backend. The guests app itself implements a user backend, and thus it's indeed weird that we cannot find the user again that was just returned by the other call. The change here ensures that the repair step runs through and does not brick the update.

}
$expectedEmail = $this->config->getUserValue($guestId, Application::APP_ID, 'email', strtolower($guestId));
if (strtolower($guest?->getSystemEMailAddress() ?? '') !== $expectedEmail) {
$this->config->setUserValue($guestId, 'guests', 'old_email', $guest?->getSystemEMailAddress() ?? '');
Expand Down
Loading