Fix for the "0 available post types" case when clicking on the "Create Post" button #1704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE UNTIL #1513 IS IN - it's NOT targeted to
developat this momentThis PR addresses an issue with attempting to click on the "Create Post" button in categories without any allowed post types (usually happens with brand new categories). Currently, we incorrectly handle this case, redirecting the user to the page that asks the user to select a post type as the category has more than one (where in fact is has none):
This PR disables the abovementioned button and adds a corresponding title text (not shown in the screenshot, a bit hard to capture) for users who cannot edit allowed category post types (anyone other than an admin ATTOW). Due to category headers having configurable colors and the styling being managed by Co-Design, I did my best to provide some workable styling (without custom overrides), but couldn't do more without tearing my hair out - if anyone wants to tackle the rest, be my guest:
For the sake of comparison, this is how the enabled button looks like now:
For users who can edit available category post types, we now redirect directly to the page where they can manage them:
The "0 types" case is also fixed just in case (even through it should now not be possible to land there by accident):
Here's how the flow will look like:
ssr-2025-07-23_07.23.00.mp4