TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: softtouch_ph on February 16, 2007, 12:18:29 PM

Title: Error when creating article
Post by: softtouch_ph on February 16, 2007, 12:18:29 PM
I get:

Incorrect integer value: '' for column 'category' at row 1
File: C:\apache\htdocs\cebucityforum.com\forum\Sources\TPortalAdmin.php
Line: 463

whenever an admin add an article and forgot to select a category for the article and he click "Save".

Is there a way to set it default from -none- to another category to prevent this?
Title: Re: Error when creating article
Post by: feeble on March 02, 2007, 10:52:12 PM
just solved this own problem for myself
i think its a bug with mysql 5, but not really sure.

goto line 451, find:
$artc=$_POST['tp_article_category'];

replace with
$artc=$_POST['tp_article_category'];
if(empty($artc))
$artc = 0;


also you will need to make this other change so you are able to amend categories
search for
elseif(substr($what,0,19)=='tp_article_category'){
                        $val=substr($what,19);
if(is_numeric($val) && $val>0)
                       db_query("UPDATE {$tp_prefix}articles SET category='$value' WHERE id=$val", __FILE__, __LINE__);
                       $go=3;
                       }


replace with
elseif(substr($what,0,19)=='tp_article_category'){
                        $val=substr($what,19);
if(is_numeric($val) && $val>0)
{
if(empty($value))
$value = 0;
                       db_query("UPDATE {$tp_prefix}articles SET category='$value' WHERE id='$val'", __FILE__, __LINE__);
}
   $go=3;
                       }
Title: Re: Error when creating article
Post by: bloc on March 09, 2007, 12:23:44 AM
Thanks, this will be adressed in TP 0.9.8.
Title: Re: Error when creating article
Post by: shieldsa on July 03, 2007, 03:22:51 PM

I'm still having the same issue w/9.8.

Fresh Install of SMF 1.1.3 and 9.8 with MySql5

Field 'shortname' doesn't have a default value
File: C:\websites\tdsrnet.com\forums\Sources\TPortalAdmin.php
Line: 463

When trying to create/save a new article.

Quote from: Bloc on March 09, 2007, 12:23:44 AM
Thanks, this will be adressed in TP 0.9.8.
Title: Re: Error when creating article
Post by: G6Cad on July 03, 2007, 04:01:42 PM
Try this
http://www.tinyportal.net/index.php?topic=14664.0
Title: Re: Error when creating article
Post by: Fus-sheva on July 05, 2007, 09:07:53 PM
Please, give the decision of this problem