From 95a12d46ca9b6289cf989bff21defe910eea5858 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 8 Apr 2020 13:35:48 +1200 Subject: [PATCH] Revert "Latest version issue fix" --- src/Extension/FluentVersionedExtension.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/Extension/FluentVersionedExtension.php b/src/Extension/FluentVersionedExtension.php index bba3dc41..a9f436bb 100644 --- a/src/Extension/FluentVersionedExtension.php +++ b/src/Extension/FluentVersionedExtension.php @@ -432,25 +432,4 @@ public static function prepoulateIdsInLocale($locale, $dataObjectClass, $populat self::$idsInLocaleCache[$locale][$table]['_complete'] = true; } } - - public function augmentMaxVersionSubSelect(SQLSelect $subSelect, DataQuery $dataQuery, $shouldApplySubSelectAsCondition) - { - //gets "real" table name as it's required for getting localised - $table = $this->owner->baseTable(); - //gets localised table name for given data record - $localisedTable = $this->owner->getLocalisedTable($table); - //generate localised && versioned table name - $versionedTable = $localisedTable . "_Versions"; - - //fetch alias from subselect - $newFrom = $subSelect->getFrom(); - $alias = trim(key($newFrom), '"'); - //add inner join to localised table - $subSelect->addInnerJoin($versionedTable, "\"{$alias}\".\"RecordID\" = \"{$versionedTable}\".\"RecordID\" AND \"{$alias}\".\"Version\" = \"{$versionedTable}\".\"Version\""); - - //get current locale - $locale = FluentState::singleton()->getLocale(); - //finally, update subselect to include requested locale - $subSelect->addWhere("\"{$versionedTable}\".\"Locale\" = '{$locale}'"); - } }