I'm not sure if this is site specific or a problem with the theme yet.

Comments

smichel’s picture

I just found this one, too. In the comment module, we have this code:

if ($edit['pid']) {
    $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0', $edit['pid']));

    $comment = drupal_unpack($comment);
    $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
    $output .= theme('comment_view', $comment);
  }
  else {
    $output .= node_view(node_load(array('nid' => $edit['nid'])));
    $edit['pid'] = 0;
  }

By testing, I see that when previewing a comment, we're in the "else" part of this test, and $comment is being set in if ($edit['id']){.

I'll keep poking at it and see if I can figure a good way to fix it. I haven't dug into the comment module too closely yet, mostly to theme it.

RobRoy’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Looks like

1. theme_comment_preview() doesn't even seem to be used. Now we are building a preview using FAPI and $output .= theme('comment_view', $comment); The problem is that $comment->picture is not getting loaded in the preview.
2. Between theme_comment_view(), phptemplate/comment.tpl.php and bluemarine/comment.tpl.php there are quite a few inconsistencies including omission of $picture and different CSS class names for the submitted by div.

But #2 is really non-critical so this patch just includes $comment->picture in the preview and let's PHPTemplate deal with the rest.

RobRoy’s picture

StatusFileSize
new970 bytes

I hate extra spaces.

drumm’s picture

Status: Needs review » Needs work

I think theme_comment_preview() should be left in and used.

RobRoy’s picture

theme_comment_preview() wasn't being used in HEAD, so are you suggesting I modify the code to use it again? What about an optional $preview = FALSE arg in theme_comment_view()? I'm fine with putting it back in there, just want to make sure that's the consensus.

ricabrantes’s picture

Version: x.y.z » 7.x-dev

This patch is applies?? Feature requests go to the current development version...

dave reid’s picture

Issue tags: +user pictures
naxoc’s picture

Status: Needs work » Closed (duplicate)