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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 515
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 228
  • Total: 228

Error "Field 'body' doesn't have a default value"

Started by CaLy, November 08, 2011, 01:26:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CaLy

SMF version: 2.0.1
TP version: 1_RC2
Default Forum Language: Spanish UTF-8
Theme name and version: WhiteBlack Ibz
Browser Name and Version:  Opera 11.52
Mods installed: Forum: Megavideo BBCode - Ad Managment 3.0.1
Error message: Field 'body' doesn't have a default value

Hello! Yesterday night I installed TP for first time , everything´s was going fine! But today when i wanted to create a new article, i got this error :

Field 'body' doesn't have a default value
File: C:\HostingSpaces\caly\tus-celebridades.com.ar\wwwroot\Sources\TPortalAdmin.php
Line: 3445


Only thing i can say is: I saw the TPortalAdmin.php and in the line 3445 the only thing there is JUSt:

);


If needed, i can post the entire TPortalAdmin.php

What´s next? Thanks in advance!

OH and btw, i needed to see in SMF Mod Site the manual install instructions for my forum version, because i installed normally, and it didnt worked at all, so i made the changes in the files by hand, and it worked!

IchBin

Hi CaLy and welcome. If TP didn't install like you said at the end of your post, that is usually the result of some server configuration problem. I've never been able to narrow down the problem myself. Have you installed other mods? Did you see the same problem?

As for the error you posted, can you look at your database in the tp_articles table, and tell me what type the column is for the 'body' row? It should say text or longtext. But I just want to make sure.

CaLy

Thanks for the answer IchBin, all the other mods i have i needed to install that way also, its a pain :( I think i will migrate to linux hosting later!

Well I was watching the DB , do you mean smf_tp_articles ?

If YES, the type is longtext , collation utf8_general_ci

IchBin

Thanks, yes that is what I was asking about. I don't know why you are getting the error though. A longtext field ('body') in this case, cannot have a default value in MySQL. THe problem is with this spot in the code:

// we need to create one first
$request = $smcFunc['db_insert']('INSERT',
'{db_prefix}tp_articles',
array('date' => 'int'),
array(time()),
array('id')
);


It is trying to insert a new row into the tp_articles table. But your server seems to think that since we are not inserting something into the 'body' row, that there must be a default value set in MySQL for that row in the table. Which should not be possible according to most of the docs I've read on it. Can you post which version of MySQL you are using on your server?

CaLy

Sure Mr IchBin, Its mysql 5.0 where i have the db of the forum. If you want, and if you want to investigate further, i can bring you the data of my hosting. Ah and btw i forgot i think its windows hosting, if you didnt know yet...

IchBin

Well I don't think I can test it. I think it is only a problem with your version of MySQL and it could likely only be a problem on windows too. Not sure what to do at this point. I'll ask some friends to see if they have heard of such an issue.

CaLy


IchBin

It would seem that this is an issue with your MySQL installation having "strict mode" turned on. From what my friends are telling me is that windows mysql installs have this turned on by default. Try changing the query I posted above to have this.

                                // we need to create one first
$request = $smcFunc['db_insert']('INSERT',
'{db_prefix}tp_articles',
array('date' => 'int', 'body' => 'string'),
array(time(), ''),
array('id')
);


It's likely there will be other errors if your MySQL is in strict mode. You might want to see if you can get it turned off.

This website is proudly hosted on Crocweb Cloud Website Hosting.