From 903c19dbeb48cd181fb311e4dcf128e4d3c31997 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 21 May 2024 22:10:52 +1000 Subject: [PATCH] Mail validation errors is now an object, and must be tested with ->count() --- app/Jobs/PacketProcess.php | 2 +- app/Models/Echomail.php | 2 +- app/Models/Netmail.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/PacketProcess.php b/app/Jobs/PacketProcess.php index af6059b..27f214a 100644 --- a/app/Jobs/PacketProcess.php +++ b/app/Jobs/PacketProcess.php @@ -88,7 +88,7 @@ class PacketProcess implements ShouldQueue // Check the packet is to our address, if not we'll reject it. if (! our_address($this->do)->contains($pkt->tftn)) { - Log::error(sprintf('%s:! Packet [%s] is not to our address? [%s]',self::LOGKEY,$this->filename,$pkt->tftn)); + Log::error(sprintf('%s:! Packet [%s] is not to our address? [%s]',self::LOGKEY,$this->filename,$pkt->tftn->ftn)); // @todo Notification::route('netmail',$pkt->fftn)->notify(new UnexpectedPacketToUs($this->filename)); break; diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index d3b9a60..bde9025 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -92,7 +92,7 @@ final class Echomail extends Model implements Packet parent::boot(); static::creating(function($model) { - if (! is_null($model->errors)) + if ($model->errors->count()) throw new \Exception('Cannot save, validation errors exist'); }); diff --git a/app/Models/Netmail.php b/app/Models/Netmail.php index a06f83a..1aa1067 100644 --- a/app/Models/Netmail.php +++ b/app/Models/Netmail.php @@ -86,7 +86,7 @@ final class Netmail extends Model implements Packet parent::boot(); static::creating(function($model) { - if (! is_null($model->errors)) + if ($model->errors->count()) throw new \Exception('Cannot save, validation errors exist'); });