BUG Satisfy the API contract - always return SS_List instance.

Currently returning null in some situations.
This commit is contained in:
Mateusz Uzdowski 2013-10-16 16:45:31 +13:00
parent a0fab3b7c2
commit 8cdeb8005e

View File

@ -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.