think I've found another one.

in the macro showCommentForm, the authentication question is rendered by the call
$pageHelper.commentAuthenticatorHtml

but the source of PageHelper shows this method amended to do nothing

    public String getCommentAuthenticatorHtml()
    {
        /* no longer used -- Allen G
         RollerContext rctx =
         RollerContext.getRollerContext(mRollerReq.getRequest());
         return rctx.getCommentAuthenticator().getHtml(
         mVelocityContext, mRollerReq.getRequest(), mResponse);
         */

        return "";
    }

so there is no auth question on the page, yet it still expects the question to be answered, before a comment may be entered.

I'm uncommenting this method and rebuilding, but is there a reason it was taken out? should comments.vm be calling something else?

B

p.s. is this the right place to report suspected bugs? I don't want to annoy people (unnecessarily)!

Ben Avery wrote:
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

Reply via email to