Skip to content

Commit

Permalink
LPS-201793 Add scopeKey parameter to fix the object entry creation wi…
Browse files Browse the repository at this point in the history
…th its related object entry for site scope Object Definitions

# breaking

## What modules/apps/object/object-rest-impl/src/main/java/com/liferay/object/rest/internal/manager/v1_0/DefaultObjectEntryManagerImpl.java

## Why

addOrUpdateNestedObjectEntries Add a new scopeKey parameter so that site-scoped nested object entries can be created

----
  • Loading branch information
magjed4289 authored and brianchandotcom committed Dec 18, 2023
1 parent 3684fb2 commit 219118b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public ObjectEntry addObjectEntry(
_addOrUpdateNestedObjectEntries(
dtoConverterContext, objectDefinition, objectEntry,
_getObjectRelationships(objectDefinition, objectEntry),
serviceBuilderObjectEntry.getPrimaryKey()));
serviceBuilderObjectEntry.getPrimaryKey(), scopeKey));
}

@Override
Expand Down Expand Up @@ -798,7 +798,8 @@ public ObjectEntry updateObjectEntry(
_addOrUpdateNestedObjectEntries(
dtoConverterContext, objectDefinition, objectEntry,
_getObjectRelationships(objectDefinition, objectEntry),
serviceBuilderObjectEntry.getPrimaryKey()));
serviceBuilderObjectEntry.getPrimaryKey(),
objectEntry.getScopeKey()));
}

@Override
Expand Down Expand Up @@ -830,7 +831,7 @@ externalReferenceCode, getGroupId(objectDefinition, scopeKey),
_addOrUpdateNestedObjectEntries(
dtoConverterContext, objectDefinition, objectEntry,
_getObjectRelationships(objectDefinition, objectEntry),
serviceBuilderObjectEntry.getPrimaryKey()));
serviceBuilderObjectEntry.getPrimaryKey(), scopeKey));
}

private Map<String, String> _addAction(
Expand Down Expand Up @@ -862,7 +863,7 @@ private Map<String, String> _addAction(
DTOConverterContext dtoConverterContext,
ObjectDefinition objectDefinition, ObjectEntry objectEntry,
Map<String, ObjectRelationship> objectRelationships,
long primaryKey)
long primaryKey, String scopeKey)
throws Exception {

Map<String, Object> properties = objectEntry.getProperties();
Expand Down Expand Up @@ -945,8 +946,7 @@ private Map<String, String> _addAction(
nestedObjectEntry = objectEntryManager.updateObjectEntry(
objectDefinition.getCompanyId(), dtoConverterContext,
nestedObjectEntry.getExternalReferenceCode(),
relatedObjectDefinition, nestedObjectEntry,
relatedObjectDefinition.getScope());
relatedObjectDefinition, nestedObjectEntry, scopeKey);

if (!manyToOneObjectRelationship) {
_relateNestedObjectEntry(
Expand Down

0 comments on commit 219118b

Please sign in to comment.