From 88a8c04d9b54253fbcd4105f58b6b89ec4f1f240 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 10 Nov 2009 01:07:29 +0000 Subject: [PATCH] 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 --- core/model/Translatable.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/model/Translatable.php b/core/model/Translatable.php index 8298cdf74..5bf0a70db 100755 --- a/core/model/Translatable.php +++ b/core/model/Translatable.php @@ -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) {