after running a live Roller 2.0 instance for a while now, we've found a
problem with the rendering of the comments details, with incorrent email
addresses being given to the comments, where there are more than one,
and email address is not mandatory in the comments entry form.
I've tracked this down to the code in
[roller_base]/WEB-INF/classes/comments.vm
line (I think) 62 does some character encoding on the email address of
the poster:
#set($email = $utilities.hexEncode($comment.email))
which is all well and good, but this same Velocimacro,
showCommentDetails, is called for all the comments on a weblog entry. If
a subsequent comment doesn't have an email address associated, then the
code remembers the last time this was set, so it may be that the first
comment's email is erroneously stuck to all subsequent comments.
to fix this, you can just reset the local $email value, so this part of
the code now looks like:
#set($email = "")
#set($email = $utilities.hexEncode($comment.email))
which is quicker than putting conditional code around it
#if( !$stringUtils.isEmpty($email) )
#set($email = $utilities.hexEncode($comment.email))
#else
#set($email = "")
#end
although you might prefer that for its transparency of meaning.
I've also modified comments.vm to sign comments as from 'Anonymous' if
none of the big conditional code block immediately below this, by adding
a final
#else
<b>Anonymous</b>
before closing with
#end
regards
--
Ben Avery
Software Developer
Youthnet UK
email: [EMAIL PROTECTED]
phone: 020 7288 7333
snail: 2-3 Upper Street
London N1 0PQ