Hi Guys,
So I've converted my old members module system across to extended users, the hardest part of this was rebuilding all comment templates to use the native couch commenting alongside extended users, rather than using custom templates for them all. For some reason, the success and error messages don't ever show.
This is the comment form block below:
All of this code works correctly... the comments are saved to the database and show for the relevant page, everything seems to run smoothly which is why I'm confused.
The only success/error message that shows is when the form is not filled in:
On top of that, I do not receive e-mails when submitting a comment, as you can see there is a send_mail block. Even without the wrapping if statement around it (Checking for admin comments), it still doesn't work.
The weirdest part is on occasion there has been the correct success message shown after commenting, but I've only seen it twice and there were no changes to the template when it worked those times, it also didn't work directly after working. I'm not quite sure what's going wrong so thought I'd post here and see if anyone can see any errors in the code that I have overlooked.
I've never experienced a weird error like this, the behavior seems totally random.
I have elsewhere within the template this code which should show the success message after the comment is submitted, but it doesn't seem to show, though the comment always successfully is added.
Any help is much appreciated.
So I've converted my old members module system across to extended users, the hardest part of this was rebuilding all comment templates to use the native couch commenting alongside extended users, rather than using custom templates for them all. For some reason, the success and error messages don't ever show.
This is the comment form block below:
- Code: Select all
<div class="comment-form" >
<cms:form method="post" class="k_form" action="<cms:show k_page_link />">
<cms:if k_success >
<cms:process_comment />
<cms:if k_process_comment_success>
<cms:if k_user_access_level ge '7'>
<cms:send_mail from='no-reply@bartonsweb.co.uk' to='contact@bartonsweb.co.uk' subject='New ticket comment'>
A new comment has been added to a ticket.
Ticket url: <cms:show k_page_link />
Ticket subject: <cms:show subject />
Username: <cms:show k_comment_author />
</cms:send_mail>
</cms:if>
<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />
<cms:else />
<section class=" error--msg">
Could not post comment! <br />
<cms:show k_process_comment_error />
</section>
</cms:if>
<cms:else />
<cms:if k_error >
<section class=" error--msg">
<h4>Fields incomplete!</h4>
<cms:each k_error >
<cms:show item /><br />
</cms:each>
</section>
</cms:if>
<cms:if "<cms:not_empty 'submit_success' />" >
<h3>Post a comment</h3>
<label for="k_comment">Your reply</label>
<cms:input type="textarea" name="k_comment" validator_msg="required=Please enter something as comment" required="1" />
<cms:input type="submit" value="Submit" name="submit"/>
</cms:if>
</cms:if>
</cms:form>
</div>
All of this code works correctly... the comments are saved to the database and show for the relevant page, everything seems to run smoothly which is why I'm confused.
The only success/error message that shows is when the form is not filled in:
- Code: Select all
<cms:if k_error >
<section class=" error--msg">
<h4>Fields incomplete!</h4>
<cms:each k_error >
<cms:show item /><br />
</cms:each>
</section>
</cms:if
On top of that, I do not receive e-mails when submitting a comment, as you can see there is a send_mail block. Even without the wrapping if statement around it (Checking for admin comments), it still doesn't work.
The weirdest part is on occasion there has been the correct success message shown after commenting, but I've only seen it twice and there were no changes to the template when it worked those times, it also didn't work directly after working. I'm not quite sure what's going wrong so thought I'd post here and see if anyone can see any errors in the code that I have overlooked.
I've never experienced a weird error like this, the behavior seems totally random.
I have elsewhere within the template this code which should show the success message after the comment is submitted, but it doesn't seem to show, though the comment always successfully is added.
- Code: Select all
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
<cms:if submit_success >
<section class="user--form success--msg flash--msg">
<h4>Comment submitted. Please wait for an admin to get back to you.</h4>
</section>
</cms:if>
Any help is much appreciated.