TinyPortal

Development => Support => Topic started by: splattercaster on March 28, 2008, 03:26:05 AM

Title: Comments can't be submitted for articles
Post by: splattercaster on March 28, 2008, 03:26:05 AM
Hi,

I hope someone can help me solve this problem. I've scanned the forum and can't find any posts relating to this error.

I have discovered that it isn't possible to submit a comment to any of the articles on my site. After clicking 'send' the site times out after some time and the browser comes back with a white screen and this message:

Quote
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.

I have also had this error once (the rest of the time is the cgi error):

Quote
Field 'subtype' doesn't have a default value
File: C:\Webroot_UKDK\Sources\TPmodules.php
Line: 213

This is the code from TPmodules.php lines 211,212,213:
Quote
         // insert the comment
         db_query("INSERT INTO {$tp_prefix}variables (value1,value2,value3,type,value4,value5)
                     VALUES('$title','$comment','$ID_MEMBER','article_comment','$time',$article)", __FILE__, __LINE__);

I'm using SMF 1.1.4 and TP 0.9.8 I'm also using the alienation theme which has been modified quite a bit, although the file TPmodules.php hasn't been altered from the original.

Can anyone shed any light on this fault, is there a problem with the sql code above or does my database have a gremlin?

Thanks,
Tim
Title: Re: Comments can't be submitted for articles
Post by: IchBin on March 28, 2008, 01:28:57 PM
Does the same thing happen in the default theme? Can you give us a test account so we can see and try it?
Title: Re: Comments can't be submitted for articles
Post by: splattercaster on March 28, 2008, 05:51:29 PM
Hi,

Thanks for the reply, yes the same thing happens with the default theme.

I have sent you a pm IchBin with the information you need.

Tim
Title: Re: Comments can't be submitted for articles
Post by: splattercaster on April 05, 2008, 08:02:57 PM
OK, I've managed to fix this myself. I decided there must be something wrong with the sql table structure or field attributes because the php code etc was identical to another SMF/TP site that I admin and that worked fine. I tried comparing the 2 sites sql tables but they are running different versions of mysql and it was difficult to establish what needed changeing.
Therefore I used logic to alter the fields circled in red, in the 'smf_tp_variables' table, to allow null values and hey presto it now works.
If anyone else has this problem here are the fields I adjusted, they used to be set as 'No' for Null and 'blank' for Default. I changed these to 'Yes' and 'NULL'.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.ukdk-clan.co.uk%2Fsql-comment-fix.JPG&hash=49fab540ca342b747537e2e53f585a7c62025115)
Title: Re: Comments can't be submitted for articles
Post by: bloc on April 05, 2008, 08:15:09 PM
Thanks, splattercaster, this was very enlightening. What PHP/MYsql version are you running?
Title: Re: Comments can't be submitted for articles
Post by: splattercaster on April 09, 2008, 02:08:01 AM
Hi Bloc,

I use:
PHP Version 5.2.3
MySQL 5.0.45

I think this subtype error is a php v5+ and/or mysql 5+ error, I've had it before, check my previous posts about article problems - I've managed to fix problems in the past with sql database tweaking because TP php code cant 'talk' to database. I've seen plenty of posts now where you quote 'yes there are problems with php5+/mysql5+ that will be looked at for future versions'
I understand this and will live with it, not all versions of everything can be catered for. I'm a software engineer so know the score.

TP is a great tool guys - good luck with the bug squashing and I look forward to the next release  :2funny:

o/