Skip to content

Commit

Permalink
Merge pull request #1414 from lucasnetau/incomplete-typeuserattr-def
Browse files Browse the repository at this point in the history
Warn when a typeUserAttr definition is unable to be processed instead of silently ignoring
  • Loading branch information
kevinchappell authored Sep 21, 2023
2 parents 7128384 + b54ff0d commit 5b40ce1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ function FormBuilder(opts, element, $) {
['array', ({ options }) => !!options],
['boolean', ({ type }) => type === 'checkbox'], // automatic bool if checkbox
[typeof attrData.value, () => true], // string, number,
].find(typeCondition => typeCondition[1](attrData))[0] || 'string'
].find(typeCondition => typeCondition[1](attrData))[0]
)
}

Expand Down Expand Up @@ -713,7 +713,9 @@ function FormBuilder(opts, element, $) {
} else if (attrValType === 'undefined' && hasSubType(values, attribute)) {
advField.push(processTypeUserAttrs(typeUserAttr[attribute], values))
} else {
continue
const def = {}
def[attribute] = typeUserAttr[attribute]
opts.notify.warning('Warning: unable to process typeUserAttr definition : ' + JSON.stringify(def))
}
}
}
Expand Down

0 comments on commit 5b40ce1

Please sign in to comment.