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

[4.x]: Categories converted to a section get a default preview target, even if the categories have no URL #12897

Closed
MoritzLost opened this issue Mar 15, 2023 · 3 comments

Comments

@MoritzLost
Copy link
Contributor

What happened?

Description

After running entrify/categories, the section created by the command includes a default preview target, even if the category doesn't have a URL. This doesn't make sense, as categories without a URL don't have frontend pages in most cases, so the preview target will only show a 404 page.

Steps to reproduce

  1. Convert an existing category without a URL to a section using entrify/categories.
  2. Check the section settings, it will include a preview target.

Expected behavior

If the category / newly created section doesn't have a URL, it also shouldn't have a preview target. If this presents technical problems, the new sections could just be created without any preview targets by default.

Craft CMS version

4.2.2

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@MoritzLost MoritzLost changed the title [4.x]: Categories converted to a section get a default preview target, even if the categories has no URL [4.x]: Categories converted to a section get a default preview target, even if the categories have no URL Mar 15, 2023
@brandonkelly
Copy link
Member

Good call. As of the next release, a “Primary entry page” preview target will only be added if the section is sourced from a category group with URLs.

@MoritzLost
Copy link
Contributor Author

@brandonkelly Great, thanks!

@brandonkelly
Copy link
Member

4.4.3 is out with that change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants