Merge pull request #152 from mateusz/return-list-bug

BUG Satisfy the API contract - always return SS_List instance.
This commit is contained in:
Ingo Schommer 2013-10-16 12:17:32 -07:00
commit 522dff2487

View File

@ -1237,7 +1237,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
@ -1283,7 +1284,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.