ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comment Problem: Form assigning superuser author_id and email

September 21, 2010 11:39am

Subscribe [3]
  • #1 / Sep 21, 2010 11:39am

    bjyama

    38 posts

    All my comments are being assigned an author_id of 1 (superuser) and shows the superuser avatar even though another registered member submitted the comment.

    - The {author} outputs the screen name of the member who submitted the comment.

    - The {author_id} outputs “1” the superuser.

    - The {avatar_url} outputs the superuser (1) avatar.

    - The {name} field in the comment form is populated with the users screen_name.

    - The {email} field in the comment form is populated with the superuser email.

    - In the CP comments have the correct member name and email associated with the comment.

    Install Information:
    MAMP Install
    EE2.1 Build 20100810
    Add-Ons: Solspace User, Word Limiter


    Note: I added the {author_id} tag to see what was being output. Comments are for logged in users only so I had originally removed the {email} tag but put it in later to debug.

    {exp:channel:entries  channel="news" limit="1" }
        <div class="article">
            <h1>{title}</h1>
            Posted by {author} on {entry_date format="%F %n, %Y"}
            <ul>
                {categories}
                <li>{category_name}</li>
                {/categories}
            </ul>
            {news_article}
        </div>{!-- CLOSE article --}
        
        <h3>Comments</h3>
    <p>    {exp:comment:entries sort="desc" orderby="date" }<br />
        <div class="comment"><br />
            {author_id}<br />
            {if avatar}<br />
            {avatar_url}<br />
            {if:else}<br />
            #<br />
            {/if}<br />
            {comment}<br />
            By {name} on {comment_date format="%Y %m %d"}</p>
    
    <p>    </div>{!-- CLOSE comment --}<br />
        {/exp:comment:entries}<br />
        <br />
        <div id="comment_form"><br />
            </p><h3>Leave a Comment</h3>
    <p>        {exp:comment:form channel="news"}</p>
    
    <p>        Name: <input type="text" name="name" value="{name}" size="50" /></p><br />
        Email: <input type="text" name="email" value="{email}" size="50" /></p><br />
        Location: <input type="text" name="location" value="{location}" size="50" /></p><br />
        URL: <input type="text" name="url" value="{url}" size="50" /></p></p>
    
    <p>        <textarea name="comment" cols="70" rows="10">{comment}</textarea></p><br />
            <input type="checkbox" name="notify_me" value="yes" {notify_me} />Subscribe to follow-ups<br />
            <input type="submit" name="submit" value="Post" /><br />
            {/exp:comment:form}<br />
        </div>{!-- CLOSE comment_form --}    <br />
        {/exp:channel:entries}

    I am probably missing something super simple here but I need help seeing it.

  • #2 / Sep 22, 2010 1:36am

    John Henry Donovan

    12339 posts

    B.J.,

    Your {exp:comment:entries} or {exp:comment:form} tags are not meant to be nested with your channel entries tag. Move them below and see if that solves your issue for you.

  • #3 / Sep 22, 2010 2:51pm

    bjyama

    38 posts

    Yup that worked! Thanks!

  • #4 / Sep 22, 2010 3:02pm

    Ingmar

    29245 posts

    Glad to hear it. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases