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 - Error on Submit

December 16, 2010 3:28pm

Subscribe [6]
  • #1 / Dec 16, 2010 3:28pm

    AaronSleeper

    16 posts

    The Issue
    I have enabled comments in a channel of my site and they seem to be mostly working but I’m attempting to set it up so the comments need to be approved by an admin prior to showing up on the site.

    I’ve figured out how to only display comments with status=“open” but I can’t get the form to set status=“pending” when a comment is submitted ... they all just show up.

    I was able to create a new status of pending and can manually set comments to pending so they disappear but I would like this to be the default setting for submissions.

    The Submit Code

    {exp:comment:form channel="Clubs" status="pending" return="" dynamic="yes"}
                                    {if logged_out}
                                        Please <a href="/account/login">login</a> to post comments.
                                    {/if}
                                    {if logged_in}
                                        <ul class="form">
                                            <li><textarea name="comment">{comment}</textarea></li>
                                            <li><input type="checkbox" name="notify_me" value="yes" {notify_me} /><label class="wide-label">Notify me of follow-up comments?</label></li>
                                            <li><input type="submit" name="submit" value="Submit" class="btn" /></li>
                                        </ul>
                                    {/if}
                                {/exp:comment:form}

    The Display Code

    {exp:comment:entries sort="desc" limit="20" status="open" channel="Clubs" paginate="both"}
                                <div class="comment {switch="one|two"}">
                                    <div class="comment-header rounded top-only">
                                        <h4>{name}</h4>
    <p>                                </div><br />
                                    <div class="comment-body rounded bottom-only"><br />
                                        <span class="comment-date">{comment_date format="%M %d, %Y"}</span><br />
                                        {comment}<br />
                                    </div><br />
                                    {paginate}<br />
                                        Page {current_page} of {total_pages} pages {pagination_links}<br />
                                    {/paginate}<br />
                                </div><br />
                            {/exp:comment:entries}

  • #2 / Dec 16, 2010 3:30pm

    AaronSleeper

    16 posts

    oooh ... and also the switch=“one|two” seems to only be returning “one” over and over

  • #3 / Dec 16, 2010 3:32pm

    AaronSleeper

    16 posts

    You can find my code here http://ellislab.com/forums/viewthread/176139/

    When you submit a comment the following error is returned

    A Database Error Occurred

    Error Number: 1146

    Table ‘MyDBNameRemoved.exp_comment_subscriptions’ doesn’t exist

    SELECT `email`, `subscription_id`, `member_id`, `notification_sent`, `hash` FROM (`exp_comment_subscriptions`) WHERE `entry_id` = ‘6’

    Filename: libraries/Subscription.php

    Line Number: 327

  • #4 / Dec 16, 2010 5:42pm

    AaronSleeper

    16 posts

    all the other posts i’ve seen have had replies really quickly. is the person who knows about this bit just on holiday at the moment?

    does anyone know of examples or resources other than the EE Documentation where I might be able to find some solutions?

  • #5 / Dec 16, 2010 7:58pm

    AaronSleeper

    16 posts

    as it turns out comments by super admins are always posted as ‘open’ i logged in as another user and the ‘pending’ setting worked

    i’m still not sure why the switch isn’t working though and my db error on submit is still open here http://ellislab.com/forums/viewthread/176140/

  • #6 / Dec 17, 2010 4:03am

    John Henry Donovan

    12339 posts

    Aaron,

    All support requests are answered in the order that they are received. Hence why if you keep bumping your own post then it will keep going to the bottom of the queue with us unaware of it happening. See out Support Policy here

    Can you try the following test to see if they alternate please?

    {exp:comment:entries limit="20" status="open" channel="Clubs"}
    {switch="one|two"}
    {/exp:comment:entries}
  • #7 / Dec 17, 2010 4:04am

    John Henry Donovan

    12339 posts

    Aaron,

    What version and build of EE are you using?
    Are you using any add-ons?

    Was this a fresh install or an upgrade from a previous version or build?

  • #8 / Dec 17, 2010 1:04pm

    AaronSleeper

    16 posts

    version 2.1.1

    Modules used copied from the modules list page in the admin
    AJW DataGrab Channel
    Channel Images
    Comment
    Dealers Module
    Email
    Emoticon
    Freeform
    IP to Nation
    jQuery
    Mailing List
    Member
    Pages
    Playa
    RSS
    Search
    Statistics
    Updated Sites

    one of our other devs said she recently updated the version of ee so i suspect the upgrade process may be a part of the issue with the missing table.

  • #9 / Dec 17, 2010 1:08pm

    AaronSleeper

    16 posts

    hahaha ... well that’s one way to ensure people don’t spam the forums.

    inserted the code ... it returned “one one one one one”

  • #10 / Dec 18, 2010 4:09pm

    Greg Salt

    3988 posts

    Hi Aaron,

    I have merged the two threads for you since they seem to be related. Firstly, which version of EE were you running before the site was upgraded?

    Cheers

    Greg

  • #11 / Dec 20, 2010 1:19pm

    AaronSleeper

    16 posts

    I’m not sure exactly which version we had prior to the upgrade. I asked the person who did the upgrade and she said she wasn’t sure but she also upgraded in October so I’m sure it was a recent version that we just upgraded from.

  • #12 / Dec 21, 2010 4:13am

    John Henry Donovan

    12339 posts

    AaronSleeper,

    Can you upgrade to the latest version 2.1.3 please making sure to use the version docs as opposed to the build docs.

    This will make sure you have the most recent set of files and let us troubleshoot from the same page.

  • #13 / Dec 21, 2010 5:08pm

    AaronSleeper

    16 posts

    we’re upgraded to 2.1.3 now.

    since the upgrade the comment submission no longer returns an error ... but it does return a blank page instead of just taking the user back to where the submitted the comment.

    i tried adding the “return” variable to the comment:entries tag but that didn’t change anything

    and the switch statement still is not functioning for me.

    edit————
    looks like my coworker turned off errors on the site so the error is the same that the exp_comment_subscriptions table is missing

  • #14 / Dec 22, 2010 2:19pm

    Brandon Jones

    5500 posts

    AaronSleeper,

    What is the value of app_version in your system/expressionengine/config/config.php file? Also, do you have a backup of the site before it was upgraded in October? It sounds like the updater may not have been run properly at that point.

  • #15 / Dec 22, 2010 2:28pm

    AaronSleeper

    16 posts

    [‘app_version’] = “213”;

    how would i go about fixing the installation if your hypothesis is correct?

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

ExpressionEngine News!

#eecms, #events, #releases