No, it never should have been nested. Does it work when you take it out, as it were?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 16, 2011 4:49pm
Subscribe [7]#16 / Feb 23, 2011 5:47pm
No, it never should have been nested. Does it work when you take it out, as it were?
#17 / Feb 24, 2011 12:01am
Nope, it doesn’t look like that makes any difference.
Why is it that it shouldn’t be nested in a channel entries tag? I have never seen anything in the documentation about that.
#18 / Feb 24, 2011 3:10am
Why is it that it shouldn’t be nested in a channel entries tag? I have never seen anything in the documentation about that.
Please note that the comment entries tag should not typically be nested inside of a standard {exp:channel:entries} tag.
Admittedly I think the wording should be a bit harsher and perhaps in a ‘notice’ type of box so it’s easier to see though.
#19 / Feb 24, 2011 1:55pm
Trevor,
Are the comments behaving for you now in your first install? if not you might try adding one third party module at a time to the second local install and comment after each one to see if one of them is conflicting with the beta.
Thanks,
Barry
#20 / Feb 26, 2011 10:47pm
@Mark-
I guess it should be added to the Comment Submission Form documentation as well.
@Barry-
No, the comments still are not working correctly. I disabled all extensions and was still having problems with the comments. I added modules 1 at a time, and had no problem posting comments in the second local install.
#21 / Feb 28, 2011 2:54am
Trevor,
Are you using any htaccess on the troublesome site?
Compare channel settings and entry settings to make sure you are able to actually submit comments.
Post your test template code here please
#22 / Feb 28, 2011 9:58pm
I tried disabling the .htaccess file, and it didn’t make any difference. All of the settings are set to allow comments. When I revert /system/expressionengine/modules/comment/mod.comment.php back to the 2.1.3 version, comments post correctly.
Here is the single entry template:
{exp:channel:entries channel="{embed:channel}" limit="1" {channel_cache} url_title="{segment_2}" {channel_disable_basic} status="open|closed"}
{if no_results}
{redirect="blog"}
{/if}
{embed="_structure/head" title="{title}"}
<div class="primary-content single-entry left col-11">
<ul class="meta">
<li class="date">
<strong class="label">Published:</strong>
{entry_date format="{date_format}"}
</li>
<li class="category">
<strong class="label">Categories:</strong>
<?php
$categories = explode(',','{categories backspace="1"}<a href="/blog/category/{category_url_title}/">{category_name}</a>,{/categories}');
for ($i = 0; $i < count($categories); $i++) {
echo $categories[$i];
if (count($categories) > 1) {
if ($i == count($categories)-2) {
echo ' & ';
} elseif ($i != count($categories)-1) {
echo ', ';
}
}
}
?>
</li>
<li class="comments">
<strong class="label">Comments:</strong>
{if comment_total == 0}<a href="http://{url_title_path="><em>Add Yours</em></a>{if:else}<a href="http://{url_title_path="><em>{comment_total}</em></a>{/if}
</li>
</ul>
{general_body}
{general_extended}
{if general_url}
<a href="http://{general_url}" class="more">Visit Site →</a>
{/if}
</div>
<div class="secondary-content right col-4">
{embed="blog/.sidebar"}
</div>
{embed="_functions/social" title="{title}" url="http://trevordavis.net/blog/{url_title}/" summary="{general_summary}"}
{embed="_functions/comments" entry_id="{entry_id}" channel="{embed:channel}"}
{embed="_structure/foot"}
[removed]{general_js}[removed]
{/exp:channel:entries}Here is the _functions/comments template:
<div id="comments" class="contain">
{exp:comment:entries entry_id="{embed:entry_id}" limit="500"}
{if count == "1"}
<h3>{total_comments} Comment{if total_comments > 1}s{/if}</h3>
<p> {/if}</p>
<p> <div class="{switch='comment|comment alt'}" id="comment-{comment_id}"><br />
<div class="contain"><br />
</p><h4>{if url}<a href="http://{url}">{if:else}<span>{/if}{name}{if url}</a>{if:else}</span>{/if}</h4>
<p> <em class="date">{comment_date format="{date_format}"}</em><br />
</div><br />
<div class="content"><br />
{comment}<br />
</div><br />
</div><br />
{/exp:comment:entries}<br />
<br />
{exp:comment:form entry_id="{embed:entry_id}" channel="{embed:channel}"}<br />
</p><h3>What do you have to say?</h3>
<p> <ol class="forms"><br />
<li><label for="name">Name</label><input type="text" class="required-field" value="{name}" id="name" name="name" /></li><br />
<li><label for="email">Email</label><input type="text" class="required-field" value="{email}" id="email" name="email" /></li><br />
<li><label for="url">Website</label><input type="text" value="{url}" id="url" name="url" /></li><br />
<li><label for="comment">Comment</label><textarea id="comment" name="comment" class="required-field"></textarea></li><br />
<li class="screen-reader"><label for="honeepot">Leave this field blank</label><input type="text" name="honeepot" id="honeepot" tabindex="999" /></li><br />
<li class="inline"><input type="checkbox" value="yes" id="save_info" name="save_info" {save_info} /><label for="save_info">Can I save your info for additional comments?</label></li><br />
<li class="inline"><input type="checkbox" value="yes" id="notify_me" name="notify_me" {notify_me} /><label for="notify_me">Can I notify you of follow-up comments?</label></li><br />
<li class="buttons"><button type="submit">Add Your Comment →</button></li><br />
</ol><br />
{/exp:comment:form}<br />
</div>Note that moving the _functions/comments embed outside of the channel:entries tag made not difference.
#23 / Mar 01, 2011 4:43pm
Can you please try with a vastly reduced template? Best to try without embeds, too, just testing basic functionality. When you try with the 2.1.4 file, what are you getting? A blank screen? An error message of sorts?
#24 / Mar 01, 2011 4:59pm
Sure, will give it a try tonight. I don’t get any sort of message; it just reloads the same page without the new comment being added.
#25 / Mar 01, 2011 9:52pm
Ok, here is the template I am using now, where 1972 is a channel entry. This is all that I have in the template:
{exp:comment:entries sort="asc" limit="20" entry_id="1972"}
{comment}
By {name} on {comment_date format="%Y %m %d"}
{/exp:comment:entries}
{exp:comment:form entry_id="1972"}
<h3>What do you have to say?</h3>
<p> <ol class="forms"><br />
<li><label for="name">Name</label><input type="text" class="required-field" value="{name}" id="name" name="name" /></li><br />
<li><label for="email">Email</label><input type="text" class="required-field" value="{email}" id="email" name="email" /></li><br />
<li><label for="url">Website</label><input type="text" value="{url}" id="url" name="url" /></li><br />
<li><label for="comment">Comment</label><textarea id="comment" name="comment" class="required-field"></textarea></li><br />
<li class="buttons"><button type="submit">Add Your Comment →</button></li><br />
</ol><br />
{/exp:comment:form}I verified that this worked with the mod.comment.php file from 2.1.3. Then when switching to 2.1.4, comments still do not work.
#26 / Mar 01, 2011 11:28pm
Your simplified code works here, substituting a working entry_id number, on 2.1.4beta. Comments are posted from the form successfully each time.
I’m uncomfortable that you’re not specifying the channel, but it does work without it in this test case, probably as all comments are in a table with unique ids. Consequence would come if you used url_title, or EE invisibly did as it normally would via dynamic, and had multiple channels - the comment wouldn’t be guaranteed to associate correctly.
I wonder what you’ve got in the segments of your URL when you call this template—and whether your case then is another of those which requires dynamic=“no” in both tag parameters to avoid EE making assumptions?
Or is it even simpler? Have you possibly got comments set to be moderated on your 2.1.4 installation, and thus are not seeing them before they are ok’d? In that case, Comment Posting Preferences for the channel. There are other prefs which might interfere also.
Should be some clues towards finding this—let Support know what you discover, please.
Regards,
Clive
#27 / Mar 01, 2011 11:42pm
When you say the simplified code works for you, are you on a fresh 2.1.4 install or an upgrade?
I literally created a test template group and template to test this. So I am calling /test/comments and the template above is all that is there. But what changed from 2.1.4 to 2.1.3 that would require a change of parameters? When I use the 2.1.3 mod.comment.php file, the comments work fine. When I use the 2.1.4 mod.comment.php file, the comments don’t post at all. All comment posting preferences are set correctly, and there is no moderation.
#28 / Mar 02, 2011 12:01am
It’s an upgrade from 2.1.3, and from any number of previous 2.x betas and 1.x over some years.
If an installation were to be dirty, it would be, and that’s one reason I use it for these things 😉
Did you try the dynamic=“no” in both tags? It could be important even with your simple URL, depending on the rules internally, as comment is usually called with URL that identifies the originating entry. I’d name that channel as well.
Normally I would say to turn on template debugging and logging, but they aren’t likely helpful here as it is a two-stage process, and they will only show you the results phase after the comment has been added (or not).
I checked to be sure the comment wasn’t just being allowed because I was logged in—with name and email given, comments are accepted just as well without this, as normal.
#29 / Mar 02, 2011 12:11am
dynamic=“no” and adding the channel on both tags didn’t make any difference.
#30 / Mar 02, 2011 12:24am
Well, I will have to leave this to Support, then.
There’s a log that can be turned on to watch the process of things behind the scenes, and they may want to work with you on that—or may want to use another way to get to a solution.
I think you’ve got the right test set up for it, and am out of ideas for quick results, then, Trevor, though I am very sure this will work out.
There is something tickling me about action codes, from the past, but I don’t think it fits here, since you lost the ability going from 2.1.3 to 2.1.4, not from 1.x to 2.x. You did clear your caches, presumably, long ago.
Regards, and the thought that it will be worth the patience,
Clive