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 not using error template in theme #3166

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

JohnNiang
Copy link
Member

What type of PR is this?

/kind bug
/area core

What this PR does / why we need it:

Currently, if there is no error.html error template in theme, but there is a 404.html error template, this will not work correctly.

We always get rendering result from global error template error.html.

This PR mainly provides a ThemeTemplateAvailabilityProvider to check if the template is available in theme instead of in globally predefined templates.

Which issue(s) this PR fixes:

Fixes #3062

Special notes for your reviewer:

  1. Download and install any theme
  2. Check the theme folder
  3. Check folder templates/error
  4. Try to remove templates/error/error.html template file
  5. Create templates/error/404.html
  6. Request a page which does not exist
  7. See the result

Does this PR introduce a user-facing change?

解决主题自定义错误模板不生效的问题。

@f2c-ci-robot f2c-ci-robot bot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jan 17, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jan 17, 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 Jan 17, 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 Jan 17, 2023
@JohnNiang
Copy link
Member Author

/ping @halo-dev/sig-halo

Copy link
Member

@guqing guqing 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 Jan 19, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 2241c08 into halo-dev:main Jan 19, 2023
@JohnNiang JohnNiang deleted the bug/error-template-not-work branch March 15, 2023 06:32
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.

主题自定义的错误页面不生效
3 participants