diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml
index 87db3291ce..fd8d5bf0fe 100644
--- a/config/alfresco/bootstrap-context.xml
+++ b/config/alfresco/bootstrap-context.xml
@@ -165,6 +165,7 @@
+
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.Dialect/AclChangeSet-Tracking2.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.Dialect/AclChangeSet-Tracking2.sql
new file mode 100644
index 0000000000..26b0a87030
--- /dev/null
+++ b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.Dialect/AclChangeSet-Tracking2.sql
@@ -0,0 +1,31 @@
+--
+-- Title: Set ACL change set timestamps to sensible values after previous incorrect update
+-- Database: Generic
+-- Since: V4.0 Schema 5033
+-- Author: Andy Hind
+--
+-- Please contact support@alfresco.com if you need assistance with the upgrade.
+--
+
+-- Migrate data
+--FOREACH alf_acl_change_set.id system.upgrade.alf_acl_change_set.batchsize
+UPDATE alf_acl_change_set
+ SET
+ commit_time_ms = (select min(t.commit_time_ms) from alf_transaction t)
+ WHERE
+ id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
+ AND commit_time_ms < (select min(t.commit_time_ms) from alf_transaction t)
+;
+
+
+--
+-- Record script finish
+--
+DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-AclChangeSet2';
+INSERT INTO alf_applied_patch
+ (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
+ VALUES
+ (
+ 'patch.db-V4.0-AclChangeSet2', 'Manually executed script upgrade V4.0: Set ACL change set timestamps to sensible values after previous incorrect update',
+ 0, 6008, -1, 6009, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
+ );
\ No newline at end of file
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index 562032a7cb..962b65f5df 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -3176,6 +3176,17 @@
+
+
+
+
+
+
+
+ classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/AclChangeSet-Tracking2.sql
+
+
+
patch.swsdpPatch
patch.swsdpPatch.description
diff --git a/config/alfresco/version.properties b/config/alfresco/version.properties
index 2e354ea6e4..b43ed78e90 100644
--- a/config/alfresco/version.properties
+++ b/config/alfresco/version.properties
@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number
-version.schema=6008
+version.schema=6009
diff --git a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
index 7fb48e0749..7acd111931 100644
--- a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
+++ b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
@@ -1519,19 +1519,6 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
nodeRef = info.getCurrentNodeNodeRef();
}
- // remove not primary parent associations
- List childAssociations = connector.getNodeService().getParentAssocs(nodeRef);
- if (childAssociations != null)
- {
- for (ChildAssociationRef childAssoc : childAssociations)
- {
- if (!childAssoc.isPrimary())
- {
- connector.getNodeService().removeChildAssociation(childAssoc);
- }
- }
- }
-
// attempt to delete the node
if (allVersions)
{
diff --git a/source/java/org/alfresco/repo/invitation/InviteHelper.java b/source/java/org/alfresco/repo/invitation/InviteHelper.java
index af0a34cee5..3791280342 100644
--- a/source/java/org/alfresco/repo/invitation/InviteHelper.java
+++ b/source/java/org/alfresco/repo/invitation/InviteHelper.java
@@ -403,7 +403,7 @@ public class InviteHelper implements InitializingBean
// Send
Action emailAction = actionService.createAction("mail");
emailAction.setParameterValue(MailActionExecuter.PARAM_TO, nodeService.getProperty(personService.getPerson(inviteeUserName), ContentModel.PROP_EMAIL));
- emailAction.setParameterValue(MailActionExecuter.PARAM_FROM, reviewer);
+ emailAction.setParameterValue(MailActionExecuter.PARAM_FROM, nodeService.getProperty(personService.getPerson(reviewer), ContentModel.PROP_EMAIL));
//TODO Localize this.
emailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Rejected invitation to web site:" + resourceName);
emailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, emailMsg);
diff --git a/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java b/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java
index 5fb70ae720..848382697d 100644
--- a/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java
+++ b/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java
@@ -31,6 +31,7 @@ import java.util.TreeMap;
import java.util.TreeSet;
import org.alfresco.config.JndiPropertiesFactoryBean;
+import org.alfresco.util.ResourceFinder;
import org.alfresco.util.config.RepositoryPathConfigBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -253,6 +254,12 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
}
super.afterPropertiesSet();
+
+ // Validate that context files exist for this path
+ if (new ResourceFinder(getParent()).getResources(getContextResourcePatterns()).length == 0)
+ {
+ throw new IllegalStateException("Invalid type " + getTypeName() + " specified for "+ getCategory() + " subsystem. No context file found");
+ }
}
/*
@@ -373,6 +380,23 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
}
}
+ private String[] getContextResourcePatterns()
+ {
+ return new String[]
+ {
+ ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName()
+ + ChildApplicationContextFactory.CONTEXT_SUFFIX,
+ ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX
+ + getCategory()
+ + '/'
+ + getTypeName()
+ + '/'
+ + ChildApplicationContextFactory.this.getId().get(
+ ChildApplicationContextFactory.this.getId().size() - 1)
+ + ChildApplicationContextFactory.CONTEXT_SUFFIX
+ };
+ }
+
/**
* A specialized application context class with the power to propagate simple and composite property values into
* beans before they are initialized.
@@ -398,18 +422,7 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
private ChildApplicationContext(Properties properties,
Map> compositeProperties) throws BeansException
{
- super(new String[]
- {
- ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName()
- + ChildApplicationContextFactory.CONTEXT_SUFFIX,
- ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX
- + getCategory()
- + '/'
- + getTypeName()
- + '/'
- + ChildApplicationContextFactory.this.getId().get(ChildApplicationContextFactory.this.getId().size() - 1)
- + ChildApplicationContextFactory.CONTEXT_SUFFIX
- }, false, ChildApplicationContextFactory.this.getParent());
+ super(getContextResourcePatterns(), false, ChildApplicationContextFactory.this.getParent());
this.compositeProperties = compositeProperties;
diff --git a/source/java/org/alfresco/repo/tenant/MultiTServiceImpl.java b/source/java/org/alfresco/repo/tenant/MultiTServiceImpl.java
index 8f517362cc..bb705ba305 100644
--- a/source/java/org/alfresco/repo/tenant/MultiTServiceImpl.java
+++ b/source/java/org/alfresco/repo/tenant/MultiTServiceImpl.java
@@ -574,7 +574,7 @@ public class MultiTServiceImpl implements TenantService
public String getUserDomain(String username)
{
// can be null (e.g. for System user / during app ctx init)
- if (username != null)
+ if ((username != null) && AuthenticationUtil.isMtEnabled())
{
int idx = username.lastIndexOf(SEPARATOR);
if ((idx > 0) && (idx < (username.length()-1)))