Skip to content

Commit

Permalink
#1657: fix eventDataSummary not getting saved correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Sep 2, 2024
1 parent 2b5978f commit b80b950
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 b80b950

Please sign in to comment.