mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-02 22:28:37 +02:00
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:
parent
c9a6d3a1b0
commit
88a8c04d9b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user