mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
BUG Fix invalid stage being specified for queried records
This commit is contained in:
parent
bb4d553b9c
commit
6a6bc6d677
@ -928,13 +928,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
// This is to prevent the overhead of writing all translations when
|
||||
// the class didn't actually change.
|
||||
$baseDataClass = ClassInfo::baseDataClass($this->owner->class);
|
||||
$currentStage = Versioned::current_stage();
|
||||
$fresh = Versioned::get_one_by_stage(
|
||||
$baseDataClass,
|
||||
Versioned::current_stage(),
|
||||
'"'.$baseDataClass.'"."ID" = ' . $this->owner->ID,
|
||||
null
|
||||
);
|
||||
$fresh = DataObject::get($baseDataClass)->byId($this->owner->ID);
|
||||
if ($fresh) {
|
||||
$changed = $changedFields['ClassName']['after'] != $fresh->ClassName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user