🐛 Database filtering for specific dates not working Fix https://github.com/siyuan-note/siyuan/issues/10518

This commit is contained in:
Daniel 2024-03-08 00:35:28 +08:00
parent 79fafad59d
commit acb894afb1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -232,7 +232,7 @@ func ParseAttributeView(avID string) (ret *AttributeView, err error) {
ret = &AttributeView{}
if err = gulu.JSON.UnmarshalJSON(data, ret); nil != err {
if strings.Contains(err.Error(), "cannot unmarshal string into Go struct field ValueRelation.keyValues.values.relation.contents of type av.Value") {
if strings.Contains(err.Error(), ".relation.contents of type av.Value") {
// v3.0.3 兼容之前旧版本,通过正则将 "relation":{"contents":[".*"],"blockIDs": 替换为 "relation":{"contents":null,"blockIDs":
data = regexp.MustCompile(`"relation":{"contents":\[".*"\],"blockIDs":`).ReplaceAll(data, []byte(`"relation":{"contents":null,"blockIDs":`))
if err = gulu.JSON.UnmarshalJSON(data, ret); nil != err {