aboutsummaryrefslogtreecommitdiff
path: root/lib/classes
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-13 15:43:59 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-13 15:43:59 +0000
commit2394ba61250dc67915488c71dea42eb4e0492833 (patch)
tree8f859d8542f5341a7681530adcaa2e1b3589e3fa /lib/classes
parent4d62dac9edb0bb0161579f740306d109b98c95cb (diff)
load translations before comparing i18n field contents in SimpleORMap::isFieldDirty(), fixes #4864
Closes #4864 Merge request studip/studip!3643
Diffstat (limited to 'lib/classes')
-rw-r--r--lib/classes/SimpleORMap.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/classes/SimpleORMap.php b/lib/classes/SimpleORMap.php
index d2cbcdc..f3993c2 100644
--- a/lib/classes/SimpleORMap.php
+++ b/lib/classes/SimpleORMap.php
@@ -2233,6 +2233,14 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
if ($this->content[$field] === null || $this->content_db[$field] === null) {
return $this->content[$field] !== $this->content_db[$field];
} else if ($this->content[$field] instanceof I18NString || $this->content_db[$field] instanceof I18NString) {
+ // Trigger loading of translations
+ if ($this->content[$field] instanceof I18NString) {
+ $this->content[$field]->toArray();
+ }
+ if ($this->content_db[$field] instanceof I18NString) {
+ $this->content_db[$field]->toArray();
+ }
+
return $this->content[$field] != $this->content_db[$field];
} else {
return (string)$this->content[$field] !== (string)$this->content_db[$field];