mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix for AR-1871 - ML ui trying to set locale as a String rather than a Locale
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7387 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,6 +39,7 @@ import org.alfresco.service.cmr.ml.MultilingualContentService;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.repository.StoreRef;
|
import org.alfresco.service.cmr.repository.StoreRef;
|
||||||
|
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
@@ -152,24 +153,17 @@ public class MultilingualDocumentAspect implements
|
|||||||
/*
|
/*
|
||||||
* TODO: Move this into MultilingualContentService#setTranslationLocale
|
* TODO: Move this into MultilingualContentService#setTranslationLocale
|
||||||
*/
|
*/
|
||||||
|
Locale localeBefore = (Locale)before.get(ContentModel.PROP_LOCALE);
|
||||||
|
|
||||||
Locale localeBefore = (Locale) before.get(ContentModel.PROP_LOCALE);
|
Locale localeAfter = null;
|
||||||
Locale localeAfter;
|
|
||||||
|
|
||||||
// the after local property type can be either Locale or String
|
|
||||||
Serializable objLocaleAfter = after.get(ContentModel.PROP_LOCALE);
|
Serializable objLocaleAfter = after.get(ContentModel.PROP_LOCALE);
|
||||||
|
if (objLocaleAfter != null)
|
||||||
if (objLocaleAfter instanceof Locale )
|
|
||||||
{
|
{
|
||||||
localeAfter = (Locale) objLocaleAfter;
|
localeAfter = DefaultTypeConverter.INSTANCE.convert(Locale.class, objLocaleAfter);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
localeAfter = I18NUtil.parseLocale(objLocaleAfter.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the local has been modified
|
// if the local has been modified
|
||||||
if(!localeBefore.equals(localeAfter))
|
if (!localeBefore.equals(localeAfter))
|
||||||
{
|
{
|
||||||
NodeRef mlContainer = multilingualContentService.getTranslationContainer(nodeRef);
|
NodeRef mlContainer = multilingualContentService.getTranslationContainer(nodeRef);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user