Studio: fix bug in displaying tag values

This commit is contained in:
Pieter Vander Vennet 2025-08-22 15:11:05 +02:00
parent 2889cbe382
commit 4449fad360
2 changed files with 11 additions and 6 deletions

View file

@ -56,9 +56,6 @@
if (schema.type === "boolean") {
rendervalue = undefined
}
if (schema.hints.typehint === "tag" || schema.hints.typehint === "simple_tag") {
rendervalue = "{tags()}"
}
let helperArgs = schema.hints.typehelper?.split(",")
let inline = schema.hints.inline !== undefined

View file

@ -424,6 +424,16 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
v = date.toISOString()
}
if (typeof v !== "string") {
if(v["asHumanString"]){
v = v.asHumanString(true, false)
}else if(typeof v === "object"){
v = JSON.stringify(v)
} else{
v = "" + v
}
}
if (useLang !== undefined && v?.translations !== undefined) {
v = v.translations[useLang] ?? v.translations["*"] ?? v?.textFor(useLang) ?? v
}
@ -438,9 +448,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
v = v.InnerConstructElement()?.textContent
}
if (typeof v !== "string") {
v = "" + v
}
v = v.replace(/\n/g, "<br/>")
} else {
// v === undefined