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.

Comments don't appear on certain entries

February 08, 2012 7:28am

Subscribe [1]
  • #1 / Feb 08, 2012 7:28am

    onedogmedia

    31 posts

    I have a baffling problem.  For certain entries on my site, the comments do not appear.  All entries use the same template, and most of them show their comments but a few do not.  Comments are enabled in the weblog, these particular entries are set to allow comments, the comments are open, and there is no comment expiration date.  I don’t moderate comments so they should post right away.

    When the entry does not show its comments, it is not just the comments of a particular person but all comments that don’t show.  Even my own comments as super admin don’t show.  It just displays what I have in {if no_results}, even though there clearly are results.

    I’ve even looked through the database and there is nothing in exp_weblog_titles or exp_comments that looks anything different from any of the other entries.  It’s happening across three different weblogs that use the same code (modified to call the correct weblog name of course).

    Any ideas???

    Here are some example pages:

    http://www.lostmylovey.com/index.php/lost-items/listing-detail/animal-alley-baby-blue-white-night-night-puppy-plush-lost/  (this has 1 comment not showing)

    http://www.lostmylovey.com/index.php/lost-items/listing-detail/kids-preferred-elephant-white-and-blue-stripes-and-polka-dots-satin-ears-a/ (3 comments not showing)

    http://www.lostmylovey.com/index.php/replacement-wanted/listing-detail/teddy-bear-named-tilly-on-tag/ (1 comment)

    Examples of what the comments look like when they DO show:

    http://www.lostmylovey.com/index.php/replacement-wanted/listing-detail/gerber-blankie-with-pink-blue-and-green-dots-and-pink-and-blue-butterflies/

  • #2 / Feb 09, 2012 2:30pm

    Dan Decker

    7338 posts

    Hi oliversitedesign,

    What version of ExpressionEngine 1 are you running? If you are not completely up-to-date, can you update and see if the problem persists?

    In the meantime, can you post the template code that is giving you trouble so we can have a look at it?

    Thanks!

  • #3 / Feb 13, 2012 10:38pm

    onedogmedia

    31 posts

    I am on EE 1.7.1, the highest I can go at the moment.  here is the code:

    <div id="comments">
       {embed="site/comment_main"}
         
       {if logged_in}
                             
       
    
    <div>Want to comment on this post?  Please type your comments below.</div> 
       
       <div class="commenttext">Instructions about comments are here…
    
    
       
       Comment will be posted by:  <b>{screen_name}</b></div>
                                                    
       {exp:comment:form weblog="replacements" preview="replacement-wanted/commentpreview"}
    
       <textarea name="comment" cols="50" rows="10">{comment}</textarea></p>
    
       {if captcha}
       Please enter the word you see in the image below:
       {captcha}
    
       <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
       {/if}
    
       <input type="submit" name="submit" value="Submit" />
       <input type="submit" name="preview" value="Preview" />
      
       {/exp:comment:form}
       {/if}
    
       </div><!--end comments-->


    I do have an embedded template which you may see up there, perhaps that is causing trouble, because the “if no results” text is what shows when this problem occurs.  It’s the same in three different templates so I wanted to reuse it.  This is the embedded template site/comment_main:

    <div id="comment_hdr"></div>
      <div id="comment_body">
      <div id="comment_inner">
                                                                           
      {exp:comment:entries status="not closed" sort="asc"}
      {if no_results}
      No comments have been  posted yet.
      {/if}
      
      <div class="commentauthor"><a href="http://{path=member/messages/pm/{author_id}}">{author}</a> on {comment_date format="%M %j %Y"}</div>
      <div class="commenttext">{comment}</div>
      
      {/exp:comment:entries}
      </div><!--comment_inner-->
      </div><!--comment_body-->
      <div id="comment_ftr"></div>
    
      {if logged_out}
      
    
    <div>Want to comment on this post?</div>  
      
      <div class="commenttext">You'll need to <a href="http://{path=%27info/register%27}" class="member">register as a member.</a>
    
      Already a member?  <a href="http://{path=%27member/login%27}" class="member">Log in.</a>
    
      Forgot your password? <a href="http://{path=%27member/forgot_password%27}" class="member">Click here.</a></div>
      {/if}
  • #4 / Feb 15, 2012 2:40pm

    Dan Decker

    7338 posts

    Hi oliversitedesign,

    Ok, let’s rule out the embed as the source of the trouble then.

    Start by making sure you aren’t using any caching on the embedded template.

    If that doesn’t bear out, take both templates and combine them into a test template that will work as a single-entry template.

    Once you have the template set up, you can access that URL. If you include a url_title or entry_id to an entry that has comments, it should display.

    I look forward to your reply!

    Cheers,

  • #5 / Feb 21, 2012 11:56pm

    onedogmedia

    31 posts

    Thank you.  That really helped.  After playing with the template awhile, I discovered what the problem was.  It wasn’t the template at all. 

    The problem was, people were posting entries with identical titles in two different weblogs, so they had the same URL Title. Since they were different weblogs, EE didn’t automatically assign it a different URL Title like this-is-url and this-is-url2, like it normally would.

    And even though each separate template was pulling that same URL title from each separate weblog, and it should have (in theory) only seen the entry that was in that particular weblog, they were conflicting.  So what I was seeing was the entry from the other weblog, where there were no comments.  Maybe it just pulled the first one that it saw in the database, regardless of the actual weblog it was in. 

    Once I changed the URL titles to be different anywhere the two were identical, the correct comments showed up.  Crazy!

    Thanks for stepping me through this thought process!

  • #6 / Feb 24, 2012 2:16pm

    Robin Sowell

    13255 posts

    Ack- good catch, oliversitedesign.  And thanks for laying it out in detail, as that will no doubt help someone else in the future.

    If you’re using a different template for each weblog, then the addition of the [url=http://expressionengine.com/legacy_docs/modules/comment/entries.html#par_weblog]weblog parameter[url] to the comment entries tag would solve the issue- or using entry ids for the url (as those will be unique).

    Now that you’ve identified the problem- are you ok with a solution?

  • #7 / Feb 24, 2012 3:15pm

    onedogmedia

    31 posts

    Yep, all good.  Thanks for helping me think it through!  😊

  • #8 / Feb 24, 2012 6:56pm

    Robin Sowell

    13255 posts

    Sounds good.  Just let us know if you run into anything else.

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

ExpressionEngine News!

#eecms, #events, #releases