Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect scope for haloCommentEnabled template variable #4385

Merged
merged 1 commit into from Aug 15, 2023

Conversation

guqing
Copy link
Member

@guqing guqing commented Aug 7, 2023

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?

修复评论启用状态的主题模板变量名作用域不正确的问题

@f2c-ci-robot f2c-ci-robot bot added this to the 2.9.x milestone Aug 7, 2023
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Aug 7, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Aug 7, 2023
@LIlGG
Copy link
Member

LIlGG commented Aug 9, 2023

/lgtm

image

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Aug 9, 2023
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit bdb8d10 into halo-dev:main Aug 15, 2023
4 checks passed
@ruibaby ruibaby modified the milestones: 2.9.x, 2.9.0 Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

评论组件 haloCommentEnabled 属性为 null
3 participants