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

Rogue post author badge #224

Open
SeanTOSCD opened this issue Jan 22, 2019 · 3 comments
Open

Rogue post author badge #224

SeanTOSCD opened this issue Jan 22, 2019 · 3 comments
Labels

Comments

@SeanTOSCD
Copy link

Something's happening in the html5_comment() method of Themedd_Walker_Comment class. The post author badge appended to the avatar loses its position-relative parent anchor tag in certain cases. My comment/post author has a website saved to the user profile, so not sure what's happening... didn't look super deep.

Standard display:
screenshot_2019-01-21 image 2019-01-21 at 7 21 58 pm png

Missing badge (it made its way up to the top of the post content):
screenshot_2019-01-21 image 2019-01-21 at 7 23 37 pm png

Note: my admin account is the author of the post and the comment. Same behavior logged in or out.

Might be beneficial to wrap the avatar and badge in their own relative-positioned container no matter what, and let the anchor tag wrap all of it.

@SeanTOSCD SeanTOSCD added the bug label Jan 22, 2019
@SeanTOSCD
Copy link
Author

That's v1.1, by the way. Unable to check master at the moment.

@amdrew
Copy link
Contributor

amdrew commented Feb 19, 2019

@SDavisMedia 👍

Can I take a look at this issue on the EDD staging site once ready? Can't replicate locally.

@SeanTOSCD
Copy link
Author

SeanTOSCD commented Feb 19, 2019

@amdrew It's fixed already and was only replicated locally. So I probably won't be able to replicate on staging.

The problem, from what I can tell, is with the first and the last line here: https://github.com/easydigitaldownloads/themedd/blob/release/1.1/includes/class-themedd-walker-comment.php#L73-#L81

The avatar and post author badge are sibling elements:
$avatar = $avatar . $post_author_badge;

Then in the condition below that code, based on whether or not the comment author URL is empty (this is the part I couldn't seem to control for replication), an anchor element wraps the aforementioned avatar and post author badge (here's the opening anchor tag):
printf( '<a href="%s" rel="external nofollow" class="url comment-author-avatar mr-3 position-relative">', $comment_author_url );

Notice that anchor tag has the position-relative class. But based on the entire conditional, there's some sort of case where the anchor tag may not exist. That's what happened to me... I just can't figure out how because the comment author had a URL as far as I can tell.

So what I'm suggesting is that no matter what, the avatar/badge siblings get their own dedicated relative positioned wrap. Even without replication of the issue, just from a markup standpoint, those two elements need a consistent wrap with relative positioning that can never be taken away by an unrelated condition.

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

No branches or pull requests

2 participants