#32096 closed defect (bug) (fixed)
Twenty Fifteen: author-bio.php clashes with "bio" username
Reported by: | lordlod | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch dev-feedback bulk-reopened |
Focuses: | Cc: |
Description
The TwentyFifteen theme uses the file author-bio.php as a partial to display author information.
However this clashes with the template hierarchy magic author-$nicename.php
This problem manifests by creating a user with the username "bio"
Then accessing their author page ?author=$id
Instead of the expected author page the raw partial is shown.
I believe a fix requires renaming author-bio.php possibly to partial-author_bio.php
References in content.php and content-link.php also would need to be updated.
Attachments (5)
Change History (28)
#1
@
9 years ago
- Component changed from Themes to Bundled Theme
- Summary changed from TwentyFifteen author-bio.php clashes with author bio to Twenty Fifteen: author-bio.php clashes with author bio
#2
@
9 years ago
- Summary changed from Twenty Fifteen: author-bio.php clashes with author bio to Twenty Fifteen: author-bio.php clashes with "bio" username
#4
@
9 years ago
- Keywords needs-patch added; 2nd-opinion close removed
Nice find @lordlod!
We can't rename the file for back compat concerns, but we can add a check if it's an archive and handle that case accordingly.
#6
@
9 years ago
It should probably be handled in the template itself since it only applies to Twenty Fifteen.
#7
@
9 years ago
Good call. I checked all the default themes and found the issue in Twenty Thirteen as well.
32096.2.diff attempts to deal with this in the theme - thoughts?
#8
@
9 years ago
I think this logic should be implemented via template_include
filter in the theme's functions.php
file.
#9
@
9 years ago
Thanks for the feedback!
Tried the filter method with 32096.3.diff
used @since Twenty Fifteen 1.2
& @since Twenty Thirteen 1.6
(assuming these would be next versions of the themes?)
#14
@
8 years ago
- Keywords dev-feedback added; needs-testing removed
This feels like a lot of code for something so edge case. I'd be keen to review this and consider if we do think it's worth doing and if that is the case, if we can find a less impactful way.
@
6 years ago
Updated patch to apply to current trunk, updated @since and added another conditional check for author post number
#17
@
6 years ago
- Keywords bulk-reopened added
- Version changed from 4.0 to trunk
IMO, this issue breaks a page which is available for anyone to view and can be crawled by the SE bots. So even though it might be an "edge" case, it is still something that should be fixed. I'm not sure that I agree that the current fix is that impactful either. It only effects template loading for this particular issue. Also, I'm not sure that there is a better way to handle it.
All that being said, I tested the most recent patch and it failed to apply, so I updated the patch against trunk. While doing so, I noticed another issue with the previous fix. If the author named bio
did not have any published posts, then the previous fix did not work, so I updated the patch to check against the authors post number.
32096.4.diff addresses all of these things:
- Refreshed patch against current trunk
- Better targeted function names to their particular theme
- Updated @since for both themes
- Added conditional check for authors published post number
I understand that there are differing opinions on whether this should be fixed, so if there are any objections to fixing this, please state your case. Otherwise, in the interest of closing out old tickets, I will recommend that this be committed into the bundled themes.
#20
@
5 years ago
- Keywords needs-refresh removed
- Milestone set to Future Release
@laurelfulford and @davidakennedy would love to get your opinion on this ticket. It may be an edge case, but IMHO since it does break a template that is publicly visible on any site using either TwentyThirteen
or TwentyFifteen
, then it should probably be fixed. I also don't see any backcompat
issues with fixing this. Thoughts?
Going to mark for Future Release
as it was marked this way before the bulk closing of stale tickets.
#21
@
5 years ago
- Milestone changed from Future Release to 5.3
Moving into 5.3
milestone for consideration, pending dev-feedback
Thank you for the report, lordlod. My opinion is this is an edge case and probably won't happen very often. Instead the author could adjust their theme (or use a child theme) to change the references and avoid the issue.
Other opinions very welcome.