From 9d04d7a2fbbb087d1f36fe955d15abf062fe9b42 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 1 Sep 2023 09:38:13 +1200 Subject: [PATCH 1/2] feat: add absolute base url for locale --- src/Model/Locale.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Model/Locale.php b/src/Model/Locale.php index 40b0eff3..72103eec 100644 --- a/src/Model/Locale.php +++ b/src/Model/Locale.php @@ -586,6 +586,16 @@ public function getBaseURL() return $base; } + /** + * Absolute base url + * + * @return false|string + */ + public function getAbsoluteBaseURL() + { + return Director::absoluteURL($this->getBaseURL()); + } + /** * Get other locales that appear alongside this (including self) * From 904e3f450d4b21e5a8b9bf5ce652290556027985 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 1 Sep 2023 12:06:03 +1200 Subject: [PATCH 2/2] chore: fix linting --- src/Extension/FluentVersionedExtension.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Extension/FluentVersionedExtension.php b/src/Extension/FluentVersionedExtension.php index 4d766384..4eaf1805 100644 --- a/src/Extension/FluentVersionedExtension.php +++ b/src/Extension/FluentVersionedExtension.php @@ -1012,8 +1012,8 @@ protected function setVersionCacheItem(string $class, string $stage, string $loc // Internally store nulls as 0 $this->versionsCache[$class][$stage][$locale][$key] = $value ?: 0; } - - /** + + /** * If an object is duplicated also duplicate existing localised values from original to new object. */ public function onAfterDuplicate($original, $doWrite, $relations): void @@ -1055,8 +1055,6 @@ public function onAfterDuplicate($original, $doWrite, $relations): void SELECT ? AS \"RecordID\", $fields_str FROM \"$versionsTableName\" WHERE \"RecordID\" = ?", [$toID, $fromID]); - } } - }