mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
BUG Satisfy the API contract - always return SS_List instance.
Currently returning null in some situations.
This commit is contained in:
parent
a0fab3b7c2
commit
8cdeb8005e
@ -1236,7 +1236,8 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
throw new InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
|
throw new InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->owner->exists()) {
|
if(!$this->owner->exists()) return new ArrayList();
|
||||||
|
|
||||||
// HACK need to disable language filtering in augmentSQL(),
|
// HACK need to disable language filtering in augmentSQL(),
|
||||||
// as we purposely want to get different language
|
// as we purposely want to get different language
|
||||||
// also save state of locale-filter, revert to this state at the
|
// also save state of locale-filter, revert to this state at the
|
||||||
@ -1282,7 +1283,6 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
|
|
||||||
return $translations;
|
return $translations;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an existing translation based on the language code.
|
* Gets an existing translation based on the language code.
|
||||||
|
Loading…
Reference in New Issue
Block a user