From c879cd1e5e3beee851a0ed0cd8ffb520343864d3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 18 Apr 2016 15:20:41 +0200 Subject: [PATCH] DbObject: compare numbers as string --- library/Director/Data/Db/DbObject.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index e8c813d1..480e04b2 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -305,7 +305,9 @@ abstract class DbObject throw new IE('Trying to set invalid key %s', $key); } - if ($value === $this->get($key)) { + if ((is_numeric($value) || is_string($value)) + && (string) $value === (string) $this->get($key) + ) { return $this; } @@ -321,6 +323,7 @@ abstract class DbObject if ($value === $this->properties[$key]) { return $this; } + $this->hasBeenModified = true; $this->modifiedProperties[$key] = true; $this->properties[$key] = $value;