Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-01 15:40:21

dfmoore
New Member
Registered: 2006-06-01
Posts: 5

Issue with commenting

What happens is that when someone tries to leave a comment, the preview button is pressed, the page just loads up with no comment, no comment form, and no submit button. The url changed from <posturl>#comment to <posturl>#cpreview, but the preview is not visible nor is the submit button. Also, if I try and reload the #cpreview page, my browser asks me to repost the form data, so it isn’t losing it.

I’m running TxP 4.0.3 and it’s located at http://www.danielfmoore.com/tp/ if you want to check for yourself.

I’ve tried turning off all my plugins/returning to complete default setup/etc. but this didn’t work.

Last edited by dfmoore (2006-06-01 15:42:05)

Offline

#2 2006-06-01 16:08:39

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Issue with commenting

Did you replace any files when you installed the live-preview? If yes, undo it, because that’s what probably broke things for you.

Otherwise: You need to enable Debug-Mode if you want us to see anything that might help in finding your error.

Alternatively:

  • Is “Automatically Append Comments” on or off?
  • Show us the article-form used
  • Show us the comments_display form (or that which you replaced it with)
  • Show us the comment-form used
  • Show us when/where the comments_display form is called (or that which you replaced with it)
  • Are you using any embedded PHP?

It’s possible that you are using some conditional that is interfering with the display of the preview.

Last edited by Sencer (2006-06-01 16:09:33)

Offline

#3 2006-06-01 18:09:29

dfmoore
New Member
Registered: 2006-06-01
Posts: 5

Re: Issue with commenting

Okay, I’ve enabled Debug-Mode and here are my answers to your questions:

1. “Automatically Append Comments” is off (I turned it on and saw no change in what happens)
2. Article-form:
<code>
<div class=“post”>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<div id=“artimg”><txp:article_image/></div><txp:body />

<div id=“artmeta”><txp:posted /> by <txp:author /></div>
<txp:comments form=“waw_comments” />
<txp:if_comments_allowed>
<txp:comments_form form=“waw_comment_form” />
<txp:else />
<p><txp:text item=“comments_closed” /></p>
</txp:if_comments_allowed>
</div>

</code>

3. Comments_display form:
<code>
<div class=“cmnt”>
<txp:comment_message />
<txp:comment_name /> | <span class=“date”><txp:comment_time /></span> | <txp:comment_permlink>#</txp:comment_permlink>
</div>
</code>

4. comment-form:
<code>
<txp:comments_error />
<div id=“cmntform”>
<h3>Add Your Comment</h3>
<p>You may use <a target=”_blank” href=“http://www.textpattern.com/help/?item=textile_comments” onclick=“window.open(this.href, ‘popupwindow’, ‘width=300,height=400,scrollbars,resizable’); return false;”>textile</a> in your comment.</p>
<span><label for=“name”>Your Name:</label><txp:comment_name_input /></span>
<span><label for=“email”>Your Email:</label><txp:comment_email_input /></span>
<span><label for=“web”>Your http://</label><txp:comment_web_input /></span>
<span><label for=“message”>Your Comment:</label><txp:comment_message_input /></span>
<span><txp:comment_remember /></span>

<txp:comment_preview />

<txp:comment_submit />

</div>
</code>

No embedded php.

Thanks!

Offline

#4 2006-06-01 18:17:41

dfmoore
New Member
Registered: 2006-06-01
Posts: 5

Re: Issue with commenting

Oh, in the article form, “waw_comments” is the comment-display form and “waw_comment_form” is the comment-form…

Offline

#5 2006-06-01 19:24:51

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Issue with commenting

Are you sure you’re not overriding the form anywhere?

Can you post a tag trace please?

Offline

#6 2006-06-01 19:31:52

dfmoore
New Member
Registered: 2006-06-01
Posts: 5

Re: Issue with commenting

Here is the tag trace of the indiv page before a comment has been posted:

<!-- txp tag trace: 
[SQL (0.000096): select name from `txp_lang` where lang='en-us' limit 1]
[SQL (0.000794): select name, data from `txp_lang` where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.000736): select name, code from `txp_plugin` where status='1']
[SQL (0.019825): select title from `txp_section` where name='blog']
[SQL (0.013140): select ID,Section from `textpattern` where url_title like 'really' AND Section='blog' limit 1]
[SQL (0.000477): select * from `txp_section` where name = 'blog' limit 1]
[SQL (0.000405): select Posted, AuthorID, Keywords from `textpattern` where ID=341]
[SQL (0.000436): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2006-06-01 08:32:00' and Section = 'blog' and Status=4 and Posted < now() order by Posted asc limit 1]
[SQL (0.000462): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2006-06-01 08:32:00' and Section = 'blog' and Status=4 and Posted < now() order by Posted desc limit 1]
[SQL (0.000093): select RealName from `txp_users` where `name` = 'Daniel' limit 1]
[SQL (0.000415): select host from `txp_log` where ip='128.61.137.156' limit 1]
[SQL (0.000468): insert into `txp_log` set `time`=now(),page='/tp/blog/really',ip='128.61.137.156',host='note7156.mse.gatech.edu',refer='',status='200',method='GET']
[SQL (0.000116): select user_html from `txp_page` where name='waw_default']
[Page: waw_default]
<txp:output_form form="waw_header" />
	[SQL (0.000175): select form from `txp_form` where `name` = 'waw_header' limit 1]
	<txp:sitename/>
	<txp:css/>
	<txp:rss_live_search_js/>
	<txp:site_url/>
	<txp:sitename/>
	<txp:rss_live_search showdate="1" inputvalue="search the archives"  inputsize="25" />
	<txp:ako_nav 
name="Home,Archives,Links,About,Contact" 
url="/,/archives,/links,/about,/contact" 
headon="0" 
title="Home,Archives,Links,About,Contact" 
/>
<txp:if_search>
	[<txp:if_search>: false]
	<txp:if_article_list>
		[<txp:if_article_list>: false]
	</txp:if_article_list>
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:article limit="1" form="waw_article" />
			[SQL (0.000838): select *, unix_timestamp(Posted) as uPosted from `textpattern` where ID='341' and Status in (4,5) limit 1]
			[article 341]
			[SQL (0.008840): select Form from `txp_form` where `name` = 'waw_article' limit 1]
			[Form: waw_article]
			<txp:permlink>
				<txp:title/>
			</txp:permlink>
			<txp:article_image/>
			<txp:body/>
			<txp:posted/>
			<txp:author/>
			<txp:comments form="waw_comments" />
				[SQL (0.000334): select Form from `txp_form` where `name` = 'waw_comments' limit 1]
				[Form: waw_comments]
				[SQL (0.007855): select *, unix_timestamp(posted) as time from `txp_discuss` where parentid='341' and visible=1 order by posted asc]
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: true]
				<txp:comments_form form="waw_comment_form" />
					[SQL (0.000510): select Form from `txp_form` where `name` = 'waw_comment_form' limit 1]
					<txp:comments_error/>
			</txp:if_comments_allowed>
	</txp:if_individual_article>
</txp:if_search>
<txp:output_form form="waw_footer" />
	[SQL (0.000248): select form from `txp_form` where `name` = 'waw_footer' limit 1]
[ --- secondpass --- ]
 -->

And here is a tag trace after the comment has been written and preview clicked on:

<!-- txp tag trace: 
[SQL (0.000129): select name from `txp_lang` where lang='en-us' limit 1]
[SQL (0.000864): select name, data from `txp_lang` where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.000889): select name, code from `txp_plugin` where status='1']
[SQL (0.000169): select title from `txp_section` where name='blog']
[SQL (0.000090): select ID,Section from `textpattern` where url_title like 'really' AND Section='blog' limit 1]
[SQL (0.000124): select * from `txp_section` where name = 'blog' limit 1]
[SQL (0.000077): select Posted, AuthorID, Keywords from `textpattern` where ID=341]
[SQL (0.000457): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2006-06-01 08:32:00' and Section = 'blog' and Status=4 and Posted < now() order by Posted asc limit 1]
[SQL (0.000393): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2006-06-01 08:32:00' and Section = 'blog' and Status=4 and Posted < now() order by Posted desc limit 1]
[SQL (0.000084): select RealName from `txp_users` where `name` = 'Daniel' limit 1]
[SQL (0.000362): select host from `txp_log` where ip='128.61.137.156' limit 1]
[SQL (0.000375): insert into `txp_log` set `time`=now(),page='/tp/blog/really',ip='128.61.137.156',host='note7156.mse.gatech.edu',refer='',status='200',method='POST']
[SQL (0.000091): select user_html from `txp_page` where name='waw_default']
[Page: waw_default]
<txp:output_form form="waw_header" />
	[SQL (0.000083): select form from `txp_form` where `name` = 'waw_header' limit 1]
	<txp:sitename/>
	<txp:css/>
	<txp:rss_live_search_js/>
	<txp:site_url/>
	<txp:sitename/>
	<txp:rss_live_search showdate="1" inputvalue="search the archives"  inputsize="25" />
	<txp:ako_nav 
name="Home,Archives,Links,About,Contact" 
url="/,/archives,/links,/about,/contact" 
headon="0" 
title="Home,Archives,Links,About,Contact" 
/>
<txp:if_search>
	[<txp:if_search>: false]
	<txp:if_article_list>
		[<txp:if_article_list>: false]
	</txp:if_article_list>
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:article limit="1" form="waw_article" />
			[SQL (0.000279): select *, unix_timestamp(Posted) as uPosted from `textpattern` where ID='341' and Status in (4,5) limit 1]
			[article 341]
			[SQL (0.000080): select Form from `txp_form` where `name` = 'waw_article' limit 1]
			[Form: waw_article]
			<txp:comments_preview bc="1" id="341" />
			<txp:permlink>
				<txp:title/>
			</txp:permlink>
			<txp:article_image/>
			<txp:body/>
			<txp:posted/>
			<txp:author/>
			<txp:comments form="waw_comments" />
				[SQL (0.000112): select Form from `txp_form` where `name` = 'waw_comments' limit 1]
				[Form: waw_comments]
				[SQL (0.000104): select *, unix_timestamp(posted) as time from `txp_discuss` where parentid='341' and visible=1 order by posted asc]
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: true]
				<txp:comments_form form="waw_comment_form" />
			</txp:if_comments_allowed>
	</txp:if_individual_article>
</txp:if_search>
<txp:output_form form="waw_footer" />
	[SQL (0.000117): select form from `txp_form` where `name` = 'waw_footer' limit 1]
[ --- secondpass --- ]
<txp:comments_preview bc="1" id="341" />
	[SQL (0.000656): select *, unix_timestamp(Posted) as uPosted from `textpattern` where ID='341' and Status >= 4]
	[article 341]
	[SQL (0.036361): select Form from `txp_form` where `name` = 'comments_display' limit 1]
	[Form: comments_display]
 -->

(Edit: updated to display code properly. :) -Mary)

Last edited by Mary (2006-06-01 21:41:47)

Offline

#7 2006-06-01 21:43:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Issue with commenting

You need to add: <txp:comments_preview form="waw_comments" />.

Offline

#8 2006-06-01 23:17:21

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Issue with commenting

Hi dfmoore,

thanks for your extensive information. I think I know what is going with your site. You write that the contents of your comments_display form is:

<div class="cmnt">
<txp:comment_message />
<txp:comment_name /> | <span class="date"><txp:comment_time /></span> | <txp:comment_permlink>#</txp:comment_permlink>
</div>

I think you got the confused with the different forms for comments (which I can understand, we will try to simplify things in the future). The tags you are using there do belong into the comments form.
The comments_display form has a different purpose. Have a look at this FAQ entry:
http://textpattern.com/faq/95/comment-display-confusion
(which gives a short overview of the different forms).

Your comments_display form should at least contain:
<txp:comments />
<txp:comments_form />

The reason is that for Backwards-compatibility reasons, the form with the name “comments_display” is hardcoded and certain tags are expected to be there – it is used for auto-append, but it is also used for previews. Unless you decide to do things your way (in which case read on):

The alternative solution (and I guess the one you might prefer), is to do what mary hinted at: Take complete control of your previews, and don’t leave things to the backwards-compatibility magic. I wrote a weblog article on it here:
http://textpattern.com/weblog/127/customizing-previews-for-commenting-in-the-upcoming-402
(it involves using a tag to display the preview and another change to show the [html-]form where people can edit/submit the comment below that preview).

And finally in 4.0.3 there was also special tags added for controling the display of error-messages:
http://textpattern.com/weblog/153/fine-tuning-the-next-release

The information is a little bit * cough * scattered at the moment, so again sorry, if that was a bit overwhelming. It would be really great if somebody took the time to write the information up in a more permanent place in Textbook. IIRC there was a recent discussion where somebody mentioned he would do it (can’t find it). So, dfmoore, if once you get things figured out, and you want to contribute such an article, or parts of such an article, you are very welcome to help.

Last edited by Sencer (2006-06-01 23:19:31)

Offline

#9 2006-06-02 02:10:10

dfmoore
New Member
Registered: 2006-06-01
Posts: 5

Re: Issue with commenting

Spencer, Mary,

Thanks so much! It works now. I turned off the debugging mode so now its all great. Thanks so much. It ended up being a combination of what both of y’all said, so maybe I’ll write something up about it in the next couple of days.

The thing is, I’ve tried MT and, though I like the interface they have, I don’t really like their lack of customisability for sites that look like things other than standard blogs. And I tried WP and I don’t really like their interface. Textpattern is just such a great piece of software when everything works right so I’m glad I got it working nicely with y’all’s help.

D

Offline

Board footer

Powered by FluxBB