Fix to getDirty() when using MD5Updates Trait on attributes

This commit is contained in:
2025-01-16 10:33:45 +11:00
parent 6e06caa83b
commit 960e0de5c8
4 changed files with 4 additions and 24 deletions

View File

@@ -233,10 +233,8 @@ class Attribute implements \Countable, \ArrayAccess
*/
public function isDirty(): bool
{
if ($this->oldValues->count() !== $this->values->count())
return TRUE;
return $this->values->diff($this->oldValues)->count() !== 0;
return ($this->oldValues->count() !== $this->values->count())
|| ($this->values->diff($this->oldValues)->count() !== 0);
}
public function oldValues(array $array): void

View File

@@ -14,13 +14,6 @@ final class JpegPhoto extends Binary
{
use MD5Updates;
public function __construct(string $name,array $values)
{
parent::__construct($name,$values);
$this->internal = FALSE;
}
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
return view('components.attribute.binary.jpegphoto')