From fdaf10477def0e6d006f475529385d351147c800 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 28 May 2025 17:03:56 +0800 Subject: [PATCH 1/3] :art: Database template fields support access to the raw value https://github.com/siyuan-note/siyuan/issues/14903 --- kernel/sql/av.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sql/av.go b/kernel/sql/av.go index c4a203d34..8a230899b 100644 --- a/kernel/sql/av.go +++ b/kernel/sql/av.go @@ -541,6 +541,8 @@ func RenderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont } else { dataModel[rowValue.Key.Name] = v.String(true) } + + dataModel[rowValue.Key.Name+"_raw"] = v // Database template fields support access to the raw value https://github.com/siyuan-note/siyuan/issues/14903 } if err = tpl.Execute(buf, dataModel); err != nil { From 64de28efafc459fa07d1f047f1fdca5ce56f86f0 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 28 May 2025 17:36:41 +0800 Subject: [PATCH 2/3] :art: Database template fields support access by ID https://github.com/siyuan-note/siyuan/issues/11237 --- kernel/sql/av.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/sql/av.go b/kernel/sql/av.go index 8a230899b..4ab79d9b2 100644 --- a/kernel/sql/av.go +++ b/kernel/sql/av.go @@ -479,6 +479,8 @@ func RenderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont } } + dataModel["id"] = map[string]any{} + dataModel["id_raw"] = map[string]any{} for _, rowValue := range rowValues { if 1 > len(rowValue.Values) { continue @@ -542,7 +544,12 @@ func RenderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont dataModel[rowValue.Key.Name] = v.String(true) } - dataModel[rowValue.Key.Name+"_raw"] = v // Database template fields support access to the raw value https://github.com/siyuan-note/siyuan/issues/14903 + // Database template fields support access to the raw value https://github.com/siyuan-note/siyuan/issues/14903 + dataModel[rowValue.Key.Name+"_raw"] = v + + // Database template fields support access by ID https://github.com/siyuan-note/siyuan/issues/11237 + dataModel["id"].(map[string]any)[rowValue.Key.ID] = dataModel[rowValue.Key.Name] + dataModel["id_raw"].(map[string]any)[rowValue.Key.ID] = v } if err = tpl.Execute(buf, dataModel); err != nil { From 901362029d49c3285453eb1b05a94fa1b5049f7e Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 28 May 2025 17:59:59 +0800 Subject: [PATCH 3/3] :bug: After enabling the Publish Service Basic authentication, the response Body is a null pointer https://github.com/siyuan-note/siyuan/issues/14925 --- kernel/server/proxy/publish.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/server/proxy/publish.go b/kernel/server/proxy/publish.go index 65d9a7666..edac7eeb6 100644 --- a/kernel/server/proxy/publish.go +++ b/kernel/server/proxy/publish.go @@ -144,6 +144,7 @@ func (PublishServiceTransport) RoundTrip(request *http.Request) (response *http. Header: http.Header{ model.BasicAuthHeaderKey: {model.BasicAuthHeaderValue}, }, + Body: http.NoBody, Close: false, ContentLength: -1, }, nil