diff --git a/src/Fields/SEOEditor.php b/src/Fields/SEOEditor.php index e9daaab..3e63424 100644 --- a/src/Fields/SEOEditor.php +++ b/src/Fields/SEOEditor.php @@ -191,12 +191,18 @@ public function isSavable() public function saveInto(DataObjectInterface $record) { - if($this->isSavable()) { + if ($this->isSavable()) { + $dbObj = null; foreach($this->getFields() as $fieldName) { if (isset($this->value[$fieldName])) { - $record->setCastedField($fieldName, !empty($this->value[$fieldName]) ? $this->value[$fieldName] : null); + $dbObj = $this->record->setCastedField($fieldName, !empty($this->value[$fieldName]) ? $this->value[$fieldName] : null); } } + + // If Fluent is present, trigger a save to enable it to save to localised tables + if (class_exists('TractorCow\Fluent\Extension\FluentExtension') && $dbObj) { + $dbObj->write(); + } } }