You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### What type of PR is this?
/kind bug
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
修复评论启用状态的主题模板变量名作用域不正确的问题
评论组件标签处理器只会在处理到 `<halo:comment/>` 自定义标签时被执行,而 haloCommentEnabled 状态是评论标签之前使用的那么此时值还没有被评论标签处理器填充所以取不到正确的值,目前的做法是在模板开始解析时填充 haloCommentEnabled 变量到 context,但这样存在的问题时无法判断页面是否使用了评论自定义标签即每个页面都会有这个变量,不过目前没有更好的办法去解决这样的问题。
how to test it?
在模板页面的任意位置使用 `${haloCommentEnabled}` 都能取到正确的值。
#### Which issue(s) this PR fixes:
Fixes#4378
#### Does this PR introduce a user-facing change?
```release-note
修复评论启用状态的主题模板变量名作用域不正确的问题
```
是什么版本出现了此问题?
2.8.0
使用的什么数据库?
H2
使用的哪种方式部署?
Docker Compose
在线站点地址
No response
发生了什么?
问题描述
使用 pr #4271 新增的属性
${haloCommentEnabled}
后,页面报错。打印此值发现如下所示:在评论组件前打印显示为 null,而在评论组件之后打印则为正常值(true/false)。
期望结果
在页面的任何位置都能正确获取到正常值。
相关日志输出
No response
附加信息
No response
The text was updated successfully, but these errors were encountered: