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