WordPress.org

Ready to get started?Download WordPress

Forums

3.1-RC2-17330 doesn't adds extra classes to comments (14 posts)

  1. danixland
    Member
    Posted 3 years ago #

    Good morning,
    I am developing a theme on 3.0.4 and in my comments.php I have this setup:

    <ol>
      <li <?php comment_class('comment'); ?>>
        <div></div>
      </li>
    </ol>

    today I was testing the theme against the latest nightly and found out that comment_class() doesn't print a lot of classes which used to be printed on 3.0.4
    EG.
    in 3.0.4 a simple subscriber user had:
    <li class="comment byuser comment-author-test even depth-2 comment" id="comment-12">

    while in revision 17330 the same subscriber user has:
    <li class="comment even depth-2 comment" id="comment-16">

    as you can see I have no way to discriminate the style of a subscriber from the style of a non-subscriber reader, it also doesn't print the bypostauthor class no more so isn't possible to make a comment by the post author look different from other comments..

    I don't understand if that's a bug or a feature that still has to be implemented and will work on 3.1 final or maybe developers decided not tu put it in WP 3.1...

    Let me know...

  2. danixland
    Member
    Posted 3 years ago #

    I've noticed I have class "comment" added two times, it was just my mistake due to copy/paste...

    sorry ;)

  3. danixland
    Member
    Posted 3 years ago #

    Revision 17355 has the same problem... any ideas?? Should I file a trac ticket??

  4. Have you installed rc3?

  5. danixland
    Member
    Posted 3 years ago #

    yep!! Updated to svn rev 17357 and the problem is still here...

    I gave a look at comment_class() and get_comment_class() in wp-includes/comment-template.php both for the 3.0.4 and the trunk branch and they are identical...

    So why this part of my theme works in 3.0.4 and not in trunk??
    Also noticed they doesn't work with twentyten too, so I can exclude is my theme's problem...

  6. Frumph
    Member
    Posted 3 years ago #

    As I said on the mailing list, I would like to know if you have a comment_class filter and would like to see your comment callback code if you could pastebin those up for me.

    I'm not having the issue where the comment_class()'s are not showing up.. with additional comment added or not

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    I also have all my extra comment classes working normally in RC3, just as an fyi

  8. danixland
    Member
    Posted 3 years ago #

    since the issue is showing up on every svn update, even using the twentyten theme, I've opened trac ticket #16394.

    Thanks everybody for replying, I hope someone can help me out with this issue..

  9. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    None of us can reproduce, as stated in #16394. It's probably a plugin or your theme.

  10. danixland
    Member
    Posted 3 years ago #

    thanks everybody for your replies, I am testing it on the latest nightly (rev 17426), without plugins and using the twentyten theme, and the classes are still missing...
    what else could this issue be related to?? I can't think of anything since I am using the standard theme on a "plugin-free" install...

    let me know something... ;)

  11. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    I have a feeling the comment was posted when the user wasn't logged in. (But with the same name, email, etc.) Check the comments table, user_id column, for comments 12 and 16. I bet that comment 16 is 0.

  12. danixland
    Member
    Posted 3 years ago #

    Hi Andrew, sorry for my late reply, I'm now testing using the theme unit test, so every comment has been imported from the xml file.

    I'm doing this test on a new different server running apache (the previous test was under lighttpd) and using twentyten with the latest svn checkout and comment classes are still missing..

    the whole user_id column is 0, so your assumption is correct, but now I don't understand if that's the correct behaviour or some kind of bug..

    In my previous test (using my custom theme) comments were also imported from an xml file, so this is clearly what makes things break..

    How am I supposed to fix this issue??

  13. Jon Cave
    WordPress Dev
    Posted 3 years ago #

    Unfortunately it is a problem with the importer which doesn't import exported user IDs associated with comments. I believe the reason this wasn't implemented is because these IDs will not reference the same user on the new site you're importing to. Missing information is better than incorrect information.

    With 3.1 exports we can now at least correctly identify comments made by users with posts but the problem would still remain for subscriber comments.

    If you need the correct user ID with a comment then I imagine you'll also want the subscriber users in which case I recommend using SQL dumps for now.

  14. Jon Cave
    WordPress Dev
    Posted 3 years ago #

    With 3.1 exports we can now at least correctly identify comments made by users with posts but the problem would still remain for subscriber comments.

    WordPress Importer 0.4-alpha2 now has this ability (NB: as mentioned above currently only for users in the export file, i.e. those with posts).

    http://plugins.trac.wordpress.org/changeset/350057

Topic Closed

This topic has been closed to new replies.

About this Topic