From 81d23564968018feb075e10396e96c2c1b056f3a Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 16 May 2014 20:08:47 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 69948: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud) 69866: Merged V4.2.2 to V4.2-BUG-FIX (V4.2.3) 69863: Fix edge-case read-only server browsing of sites that require the tagscope aspect (MNT-11310) 69864 (RECORD-ONLY): Removed deep svn:mergeinfo 69865 (RECORD-ONLY): Undo r69863 (MNT-11310) as incorrect branch git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@70464 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/site/SiteServiceImpl.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/source/java/org/alfresco/repo/site/SiteServiceImpl.java b/source/java/org/alfresco/repo/site/SiteServiceImpl.java index 215e5532ca..4817463a85 100644 --- a/source/java/org/alfresco/repo/site/SiteServiceImpl.java +++ b/source/java/org/alfresco/repo/site/SiteServiceImpl.java @@ -2860,26 +2860,31 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic final NodeRef container = containerTmp; // Ensure the calendar container has the tag scope aspect applied to it - if(! taggingService.isTagScope(container)) + if (!taggingService.isTagScope(container)) { if(logger.isDebugEnabled()) { logger.debug("Attaching tag scope to " + componentName + " " + container.toString() + " for " + siteShortName); } - AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork() { - public Void doWork() throws Exception - { - transactionService.getRetryingTransactionHelper().doInTransaction( - new RetryingTransactionCallback() { - public Void execute() throws Throwable { - // Add the tag scope aspect - taggingService.addTagScope(container); - return null; - } - }, false, true + AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork() + { + public Void doWork() throws Exception + { + RetryingTransactionHelper txnHelper = transactionService.getRetryingTransactionHelper(); + txnHelper.setForceWritable(true); + txnHelper.doInTransaction( + new RetryingTransactionCallback() + { + public Void execute() throws Throwable + { + // Add the tag scope aspect + taggingService.addTagScope(container); + return null; + } + }, false, true ); return null; - } + } }, AuthenticationUtil.getSystemUserName()); }