Skip to content

Commit

Permalink
fix(plugin-workflow): fix non-existed field in collection trigger cau…
Browse files Browse the repository at this point in the history
…se error (nocobase#5318)
  • Loading branch information
mytharcher authored Sep 25, 2024
1 parent d335ffe commit 2f57076
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ async function handler(this: CollectionTrigger, workflow: WorkflowModel, data: M
changed &&
changed.length &&
changed
.filter(
(name) => !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(collection.getField(name).options.type),
)
.filter((name) => {
const field = collection.getField(name);
return field && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.options.type);
})
.every((name) => !data.changedWithAssociations(getFieldRawName(collection, name)))
) {
return;
Expand Down

0 comments on commit 2f57076

Please sign in to comment.