Skip to content

Commit

Permalink
Merge pull request #1658 from Accenture/bug/1657-eventsummary-not-dep…
Browse files Browse the repository at this point in the history
…loyed-correctly-as-string

bug/1657 fix eventDataSummary not getting saved correctly
  • Loading branch information
JoernBerkefeld authored Sep 2, 2024
2 parents 1d7fe93 + b5d8cec commit 39e440f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ class Event extends MetadataType {
if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) {
// TODO instead, remove in postRetrieve and re-add in preDeploy
errors.push(
`Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary`
`Field ${object.dePrefix + fieldName} is listed under eventDataConfig${object.referenceObject ? ` for referenceObject ` + object.referenceObject : ''} but not in eventDataSummary`
);
}
}
Expand All @@ -704,7 +704,11 @@ class Event extends MetadataType {
const fieldPath = fieldName.split(':');
fieldName = fieldPath.pop();
const dePrefix = fieldPath.join(':') + ':';
if (!dePrefixFields[dePrefix].includes(fieldName)) {
if (!dePrefixFields[dePrefix]) {
errors.push(
`Field ${dePrefix + fieldName} is listed under eventDataSummary but object ${dePrefix} was not found in eventDataConfig`
);
} else if (!dePrefixFields[dePrefix]?.includes(fieldName)) {
errors.push(
`Field ${dePrefix + fieldName} is listed under eventDataSummary but not in eventDataConfig`
);
Expand Down Expand Up @@ -956,10 +960,9 @@ class Event extends MetadataType {
'object' === typeof ca.eventDataConfig
? JSON.stringify(ca.eventDataConfig)
: ca.eventDataConfig;
ca.eventDataSummary =
'object' === typeof ca.eventDataSummary
? ca.eventDataSummary.join('; ') + '; '
: ca.eventDataSummary;
ca.eventDataSummary = Array.isArray(ca.eventDataSummary)
? ca.eventDataSummary.join('; ') + '; '
: ca.eventDataSummary;
ca.passThroughArgument =
'object' === typeof ca.passThroughArgument
? JSON.stringify(ca.passThroughArgument)
Expand Down

0 comments on commit 39e440f

Please sign in to comment.