Forum
Blog Comments Don't Get Posted
Whenever you try to post a comment on a blog post it doesn't appear on the admin area or on the website. Also, the success message doesn't appear either. I even checked phpMyAdmin and everything is setup correctly so I don't know why comments aren't being posted. Please help!
Diagnostic Information
Perch: 2.8.4, PHP: 5.4.37, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.4), assets (2.8.4), categories (2.8.4), perch_blog (4.6)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/npsantini/public_html/santini_io/perch
PERCH_CORE: /home/npsantini/public_html/santini_io/perch/core
PERCH_RESFILEPATH: /home/npsantini/public_html/santini_io/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 32M, Max POST 48M, Memory: 64M, Total max file upload: 32M
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/npsantini/public_html/santini_io
HTTP_HOST: santini.io
Comment_form.html
<perch:if id="postAllowComments" value="1">
<perch:form id="comment" method="post" app="perch_blog" class="comment-form" action="<perch:blog id="postURL" />">
<fieldset>
<legend>Leave a comment</legend>
<div>
<perch:label for="commentName">Name</perch:label><br/>
<perch:input type="text" id="commentName" required="true" label="Name" antispam="name" />
<perch:error for="commentName" type="required">Required</perch:error>
</div>
<div>
<perch:label for="commentEmail">Email</perch:label><br/>
<perch:input type="email" id="commentEmail" required="true" label="Email" antispam="email" />
<perch:error for="commentEmail" type="required">Required</perch:error>
<perch:error for="commentEmail" type="format">Check format of address</perch:error>
</div>
<div>
<perch:label for="commentURL">Website</perch:label><br/>
<perch:input type="url" id="commentURL" placeholder="https://" label="URL" antispam="url" />
</div>
<div>
<perch:label for="commentHTML">Comment</perch:label><br/>
<perch:input type="textarea" id="commentHTML" required="true" label="Message" antispam="body" />
<perch:error for="commentHTML" type="required">Required</perch:error>
</div>
<div>
<perch:input type="hidden" id="postID" value="<perch:blog id="postID" />" />
<perch:input type="submit" id="submitComment" value="Submit" />
</div>
</fieldset>
<perch:success>
<p>Thank you. Your comment has been submitted and will appear on the site once approved.</p>
</perch:success>
</perch:form>
</perch:if>
comment.html
<perch:before>
<h2>Comments</h2>
<ul class="comments listing">
</perch:before>
<li id="comment<perch:blog id="commentID" type="hidden" />">
<img src="//www.gravatar.com/avatar/<perch:blog id="commentEmail" type="email" label="Email" order="2" hash="md5" required="true" />?s=120&d=mm" width="60" height="60" />
<div class="comment">
<div class="commenter">
<perch:if exists="commentURL"><a href="<perch:blog id="commentURL" type="url" label="URL" order="3" />"></perch:if>
<strong><perch:blog id="commentName" type="text" label="Name" order="1" required="true" />:</strong>
<perch:if exists="commentURL"></a></perch:if>
</div>
<p rel="bookmark" class="date"><perch:blog id="commentDateTime" format="%d %b %Y %X" type="date" time="true" label="Date" /></p>
<perch:blog id="commentHTML" encode="false" html="true" type="textarea" label="Message (HTML)" order="4" required="true" />
</div>
</li>
<perch:after>
</ul>
</perch:after>
post.php (Note: This is only a snippet of the post.php page)
<?php perch_blog_post_comments(perch_get('s'));?>
<?php perch_blog_post_comment_form(perch_get('s')); ?>
If you turn on debug for the page and submit a comment, what happens?
I don't know if this has anything to do with it but this appears under a tab in the google chrome developer console:
Failed to clear temp storage: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. SecurityError
If you clear that error does it return?
No it doesn't.
It's possibly not from Perch then.
OK I guess what I will have to do is reinstall it because I didn't see if the comments worked before changing the templates even though I don't think that is the problem.
I reinstalled the blog app and it still doesn't work. Is it possible that form action is wrong? Right now this what it is
It just seems like it would need to be something else. Like a form handler not the page that the comment form was on.
If you turn on debug for the page and submit a comment, what happens?
Nothing. The page just refreshes without showing the success text and without actually posting the comment.
And there's zero debug output?
Maybe I am doing that wrong. I hit f12 to go to the chrome developer console and then I go to the console tab which usually is where errors would be located the only error was the missing logo.
See here: https://docs.grabaperch.com/docs/installing-perch/configuration/debug/
This is the debug message from the post page after the comment was submitted.
That's strange - I can't see the form being posted at all.
Are you doing any server side redirects?
Not that I know of. This is my .htaccess code. I don't know if this has anything to do with it. If there is code that seems out of the ordinary, it is because the people over at godaddy added it as a fix because for some reason some people where not able to view my sites hosted with them. I hope this isn't the case but I have had problems in the past with my godaddy hosting.
.htaccess code
You have redirects in place to strip
.php
extensions. What does the action on the comment form look like? Is it being caught by that redirect?That was the problem. I deleted the current .htaccess file in order to see if that was in fact the problem and it was.
Thanks for your help. You are the man!