mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 09:05:59 +00:00
Merge pull request #152 from mateusz/return-list-bug
BUG Satisfy the API contract - always return SS_List instance.
This commit is contained in:
commit
522dff2487
@ -1237,7 +1237,8 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
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(),
|
||||
// as we purposely want to get different language
|
||||
// also save state of locale-filter, revert to this state at the
|
||||
@ -1283,7 +1284,6 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
|
||||
return $translations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an existing translation based on the language code.
|
||||
|
Loading…
x
Reference in New Issue
Block a user