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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 334
  • Total: 334

Getting Default Value Errors

Started by pgc_boss, April 25, 2008, 03:06:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pgc_boss

I'm using a clean install to test the latest TinyPortal and I'm running into problems.

Specifications

OS:Windows 2003 SP1
WebServer:Apache 2.0.59
PHP:5.2.3
DB:MySQL 5.0.37
SMF:1.1.4
TP:1.052

Specifically the error is occurring when I attempt to add a new article.

QuoteDatabase Error
Field xxxxxx doesn't have a default value
File: D:\Data\Websites\Content\smf\Sources\TPortalAdmin.php
Line: 867

where the field started off as 'shortname'. I searched the site and checked the resolution. I resolved this by setting the 'shortname' field as NOT NULL. Then the error pops up for 'sticky', and now 'topic' has turned up after setting 'sticky' to NOT NULL.

Line 867 reads:
db_query("INSERT INTO {$tp_prefix}articles (date,body,intro,useintro,category,frontpage,subject,authorID,author,frame,approved,off,options,parse,comments,comments_var,views,rating,voters,ID_THEME,fileimport)
VALUES('$artd','$artbb','$arti','$artu','$artc','$artf','$arts','$nameb','$name','$artframe','$artpp','0','$artoptions',0,0,'',0,'','',0,'$artimp')", __FILE__, __LINE__);


This error is still happening after running manual_tp_install.php
All the fields in smf_tp_articles are set to NOT NULL (bear in mind that this is a clean install as well).

Dragooon

Can you tell what field is that.......

pgc_boss

Quote from: Dragooon on April 25, 2008, 04:36:32 PM
Can you tell what field is that.......
I've shelved my testing of this for the time being.

Looking through the files, it seems that when the new smf_tp_articles table is created, all the fields are set to NOT NULL but they aren't given a default value.

When the query on line 867 runs, there are several fields that aren't being populated (including 'shortname', 'topic' and 'sticky'). Since they're set to NOT NULL without a default value, I'm getting the error repeatedly.

Dragooon

I know why you are getting those problems and I know that they don't got a default value, the reason for the error is TP is not inserting the value to a field which is set a NOT NULL but since it doesn't got a default value MySQL gets angry

Now if you want it to be fixed, you need to tell us the Field which is throwing the error......

bloc

This will be resolved in the next beta.

pgc_boss

Quote from: Dragooon on April 25, 2008, 05:18:36 PM
Now if you want it to be fixed, you need to tell us the Field which is throwing the error......

As I said in my last post, I'm getting the error repeatedly. All the missing fields in that query are throwing this error at me. As soon as I've fixed one error, the next field throws an error. A quick cross-reference between the query and the table shows me that the following fields are throwing the error:

  • shortname
  • sticky
  • topic
  • locked
  • illustration
  • headers

Given that Bloc says that it's to be fixed in the next beta, I'm happy to hold off on my testing until that's ready.

This website is proudly hosted on Crocweb Cloud Website Hosting.