diff --git a/CHANGELOG.md b/CHANGELOG.md index c25dbc7..820e05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ instead carried by the app description, the git tag, the release, and this file. - App store listing: the author's e-mail address is shown. - App store listing: the homepage link points to the GitHub repository instead of back to the app store page itself. +- The notification for a location without a successful backup read "No successful backup to … + since never" when there had never been one; it now reads "No successful backup to … yet". ### Fixed - 0.9.4 could not open a repository at the root of an SFTP location (empty path): its faster diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 3cb9dd9..c1d05ae 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -51,7 +51,10 @@ final class Notifier implements INotifier { $notification->setParsedMessage($l->t('Backups stop when the limit is reached. Raise the limit, or let the retention policy remove older backups.')); break; case 'backup_stale': - $notification->setParsedSubject($l->t('No successful backup to %1$s since %2$s', [$p['target'], $p['since']])); + // 'never' was stored by 0.9.4 and earlier + $notification->setParsedSubject(in_array($p['since'] ?? '', ['', 'never'], true) + ? $l->t('No successful backup to %s yet', [$p['target']]) + : $l->t('No successful backup to %1$s since %2$s', [$p['target'], $p['since']])); $notification->setParsedMessage($l->t('Check the backup settings and the server log.')); break; case 'security_event': diff --git a/lib/Service/AlertService.php b/lib/Service/AlertService.php index 817e78a..ace1dc8 100644 --- a/lib/Service/AlertService.php +++ b/lib/Service/AlertService.php @@ -104,7 +104,7 @@ final class AlertService { } $this->appConfig->setValueString(Application::APP_ID, $key, date('Y-m-d')); $this->notifyAdmins('backup_stale', 'stale-' . $target->getId() . '-' . date('Y-m-d'), - ['target' => $target->getName(), 'since' => $last ? date('Y-m-d H:i', $lastTime) : 'never']); + ['target' => $target->getName(), 'since' => $last ? date('Y-m-d H:i', $lastTime) : '']); } private function notifyAdmins(string $subject, string $objectId, array $params): void {