1
0
Fork 0
mirror of synced 2024-09-28 07:11:40 +12:00

Fixing an issue uncovered by tests, MS-SQL and MariaDB when columns are aliased don't always return an array, they may return a stringified version. Making the reference processor more hardy against this.

This commit is contained in:
mike12345567 2024-03-19 16:11:26 +00:00
parent e0805f7056
commit 4efec72b4d

View file

@ -68,8 +68,16 @@ export async function processOutputBBReferences(
return value || undefined
}
const ids =
typeof value === "string" ? value.split(",").filter(id => !!id) : value
let ids: string[] = []
if (typeof value === "string") {
try {
ids = JSON.parse(value)
} catch (err) {
ids = value.split(",").filter(id => !!id)
}
} else if (Array.isArray(value)) {
ids = value
}
switch (subtype) {
case FieldSubtype.USER: