mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
APPSREPO-549 : [3.1]CLONE - Error when Declare Record Rule has "Hide" selected (#263)
- small fix to prevent IndexOutOfBoundsException when generating RecordCreatedEvent for records that have been hidden on creation
This commit is contained in:
committed by
Andrei Rebegea
parent
cb2008eb61
commit
44cd5f14d0
@@ -1033,8 +1033,13 @@ public class EventsServiceImpl extends AbstractEventsService implements EventsSe
|
|||||||
//When a node is declared as a record, a secondary association is created for the original location, hence use just that.
|
//When a node is declared as a record, a secondary association is created for the original location, hence use just that.
|
||||||
List<Path> allPaths = nodeService.getPaths(nodeRef, false);
|
List<Path> allPaths = nodeService.getPaths(nodeRef, false);
|
||||||
Path primaryPath = nodeService.getPath(nodeRef);
|
Path primaryPath = nodeService.getPath(nodeRef);
|
||||||
|
|
||||||
|
if (allPaths.size() >= 2)
|
||||||
|
{
|
||||||
allPaths.remove(primaryPath);
|
allPaths.remove(primaryPath);
|
||||||
List<Path> secPath = Collections.singletonList(allPaths.get(0));
|
}
|
||||||
|
|
||||||
|
List<Path> recordPath = Collections.singletonList(allPaths.get(0));
|
||||||
|
|
||||||
Event event = RecordCreatedEvent.builder()
|
Event event = RecordCreatedEvent.builder()
|
||||||
.seqNumber(nextSequenceNumber())
|
.seqNumber(nextSequenceNumber())
|
||||||
@@ -1045,8 +1050,8 @@ public class EventsServiceImpl extends AbstractEventsService implements EventsSe
|
|||||||
.siteId(nodeInfo.getSiteId())
|
.siteId(nodeInfo.getSiteId())
|
||||||
.nodeId(nodeInfo.getNodeId())
|
.nodeId(nodeInfo.getNodeId())
|
||||||
.nodeType(nodeInfo.getType().toPrefixString(namespaceService))
|
.nodeType(nodeInfo.getType().toPrefixString(namespaceService))
|
||||||
.paths(getPaths(secPath, Arrays.asList(nodeInfo.getName())))
|
.paths(getPaths(recordPath, Arrays.asList(nodeInfo.getName())))
|
||||||
.parentNodeIds(this.getNodeIdsFromParent(secPath))
|
.parentNodeIds(this.getNodeIdsFromParent(recordPath))
|
||||||
.username(AuthenticationUtil.getFullyAuthenticatedUser())
|
.username(AuthenticationUtil.getFullyAuthenticatedUser())
|
||||||
.nodeModificationTime(nodeInfo.getModificationTimestamp())
|
.nodeModificationTime(nodeInfo.getModificationTimestamp())
|
||||||
.client(getAlfrescoClient(nodeInfo.getClient()))
|
.client(getAlfrescoClient(nodeInfo.getClient()))
|
||||||
|
Reference in New Issue
Block a user