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 the problem of post list is incomplete due to no recursive query categories #1781

Merged
merged 2 commits into from
Mar 28, 2022

Conversation

guqing
Copy link
Member

@guqing guqing commented Mar 28, 2022

What this PR does?

修复由于根据分类id查询文章时方法内没有查询该分类的子分类下的文章导致状态没有更新问题
场景如下:
1、创建一个分类A,进行加密
2、创建一个分类B,挂在分类A下
3、发布一个新的文章: 文章1, 挂在分类B下

此时 文章1 的状态为“私密”
4、将分类A的密码删除
此时 文章1 的状态仍然为“私密”, 期望为草稿状态(取消私密状态)

Why we need it?

修复 #1779 但没有完全修复,该问题的第6、重选 文章1 的分类, 重新进行发布,文章1 的状态仍然为“私密”的问题无法在1.5.x解决,需要将status字段的职能拆分才可以。

文章的分类变更时没法去更新文章状态,因为:

  1. 现有文章:post-1 所属加密分类则状态为私密
  2. 用户修改文章为非私密分类并发布文章
  3. 由于 status 混在一个字段,从原 私密 -> 非私密状态文章就会转草稿
  4. 也就是出现了发布文章但文章状态为草稿的情况。

所以该问题无法在现有表结构基础上解决,且1.5.x不再进行大的改动,结合以上矛盾点该 Issue 将被挂起到 2.0 milestone 彻底解决。

How to test it?

  1. 创建分类 分类1及子分类分类1-1
  2. 创建文章 test1
  3. test1所属分类1-1
  4. 分类1设置一个密码
  5. 期望test1为加密状态
  6. 取消 分类1 的密码
  7. 期望test1为草稿状态

/cc @halo-dev/sig-halo

@guqing guqing self-assigned this Mar 28, 2022
@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 Mar 28, 2022
@ruibaby
Copy link
Member

ruibaby commented Mar 28, 2022

/kind bug

@f2c-ci-robot f2c-ci-robot bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 28, 2022
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

建议添加相关的测试用例如果方便的话。

@guqing
Copy link
Member Author

guqing commented Mar 28, 2022

/cc @JohnNiang

@f2c-ci-robot f2c-ci-robot bot requested a review from JohnNiang March 28, 2022 06:53
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2022
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing, JohnNiang

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 merged commit f5f7ddb into halo-dev:master Mar 28, 2022
@guqing guqing deleted the bugfix/1779 branch March 28, 2022 09:04
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants