TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 302
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 233
  • Total: 233

Error when creating article

Started by softtouch_ph, February 16, 2007, 12:18:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

softtouch_ph

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?

feeble

#1
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;
                       }

bloc

Thanks, this will be adressed in TP 0.9.8.

shieldsa


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.


Fus-sheva

#5
Please, give the decision of this problem

This website is proudly hosted on Crocweb Cloud Website Hosting.