BUGFIX Returning TRUE on Translatable->hasTranslation() if called on a record that is in the current locale (merged from r91032)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@91156 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-10 01:07:29 +00:00 committed by Sam Minnee
parent c9a6d3a1b0
commit 88a8c04d9b

View File

@ -1175,7 +1175,10 @@ class Translatable extends DataObjectDecorator implements PermissionProvider {
* @return boolean
*/
function hasTranslation($locale) {
return (array_search($locale, $this->getTranslatedLocales()) !== false);
return (
$this->owner->Locale == $locale
|| array_search($locale, $this->getTranslatedLocales()) !== false
);
}
function AllChildrenIncludingDeleted($context = null) {