TinyPortal

Development => Support => Topic started by: Wivelrod on July 24, 2007, 04:50:36 PM

Title: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 24, 2007, 04:50:36 PM
Hi,

I've just done a clean install of SMF 1.1.3 and the latest version of TP (TP_0983.zip), and I am getting the following error when I try to do certain tasks with articles:

QuoteField 'subtype' doesn't have a default value
File: G:\websites\order-of-the-rose\htdocs\forum\Sources\TPortalAdmin.php
Line: 404

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.3, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.

I found the following post: http://www.tinyportal.net/index.php?topic=15119.0 -which seems to be similar to the issue I have. So I uploaded and ran "manual_tp_install.php" from the download page, yet the problem remains.

BTW, this is my first experience with php and mySQL, so if someone is able to help, please ensure the instructions are clear ;)

Thanks in advance
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on July 24, 2007, 06:03:17 PM
The error tells you the error and what you need to do.
You need to update your DB with the SMF big upgrade package.
Download, take out the 2 sql files and the upgrade.php and upload them to where you have the forum installed, then point the browser to the upgrade.php and it will fix the error you have, then do the same for TP
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 24, 2007, 07:09:16 PM
Why would I have to "upgrade" when its a clean install of SMF with the latest release - is this a bug in deployment?
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on July 24, 2007, 07:23:54 PM
You have to ask that on SMF, but we have seen it a coupple of times now, and to fix it, you have to do the steps i said.
Could be that the SQL and PHP have diffrent settings that doesent apply correct during the install, but when you upgrade the tables again they get red correct.
SMF have the answers, or they should be able to give you more information though.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 24, 2007, 11:21:23 PM
okey dokey, will do it in the morning. thanks for the help :)
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 25, 2007, 09:47:48 AM
Unfortunately this did not work.

Update.php, upgrade_1-1.sql and upgrade_1-0.sql were copied into my /forum folder and run. No errors were reported.

I now get:

QuoteField 'subtype' doesn't have a default value
File: G:\websites\order-of-the-rose\htdocs\forum\Sources\TPortalAdmin.php
Line: 404

The hint about database version has been removed by running update, but the error remains.

I can cross post this on the SMF forum too, but there is nothing wrong with the actual functionality of the forum itself. This is only happening using TP functions, such as modifying the demo article or adding new articles and categories.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on July 25, 2007, 09:49:47 AM
Did you update the TP database tables to ?

then point the browser to the upgrade.php and it will fix the error you have, [b]then do the same for TP[/b]

Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 25, 2007, 10:00:33 AM
I've rerun manual_tp_install.php.

Quote"    * Upshrink table exists
    * Settings table exists
          o Updated version to 098
    * Blocks table exists
          o Changed pos in blocks table
          o Changed pos in blocks table
    * Variables table exists
          o Changed value5 in variables table
    * Articles table exists
          o Updated body in articles table
    * DL manager table exists
    * Shoutbox table exists

TinyPortalÃ,´s table structure is now installed/updated."

No change in error message when adding a new article category :(.

Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 25, 2007, 10:10:44 AM
Could this be a mySQL version issue?

I have a second site I was using to test SMF originally hosted on another ISP. I've installed TP there and it seems to work ok, I can create new categories.

On the newer site the problem remains. I've completely uninstalled and deleted the TP package and reinstalled it.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 25, 2007, 10:14:33 AM
Version Information:
Forum version: SMF 1.1.3 (more detailed)
Current SMF version: SMF 1.1.3
PHP version: 5.2.0
MySQL version: 5.0.27-community-nt
Server version: Microsoft-IIS/6.0
GD version: bundled (2.0.28 compatible)
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 25, 2007, 10:57:36 AM
sorry. more info that might help someone get me a resolution (can never have enough eh?)

line 404 is:

Quotedb_query("INSERT INTO {$tp_prefix}variables (value1,value2,value3,type,value4,value5) VALUES('$catn','$catp','','category','',0)", __FILE__, __LINE__);

Table variables is defined as the following when scripting the database via portal admin:
Quote
#
# Table structure for table `smf_tp_variables`
#

DROP TABLE IF EXISTS `smf_tp_variables`;

CREATE TABLE `smf_tp_variables` (
  id int(11) NOT NULL auto_increment,
  value1 text NOT NULL default '',
  value2 text NOT NULL default '',
  value3 text NOT NULL default '',
  type tinytext NOT NULL default '',
  value4 text NOT NULL default '',
  value5 int(11) NOT NULL default -2,
  subtype tinytext NOT NULL default '',
  value7 text NOT NULL default '',
  value8 text NOT NULL default '',
  PRIMARY KEY (id)
) TYPE=MyISAM;

#
# Dumping data in `smf_tp_variables`
#

INSERT INTO `smf_tp_variables`
   (`id`, `value1`, `value2`, `value3`, `type`, `value4`, `value5`, `subtype`, `value7`, `value8`)
VALUES (1, 'Portal features', 0, '', 'category', '', -2, '', '', ''),
   (3, 'Demo articles', 0, 'cats1', 'menubox', 0, 10, '', '', '');
# --------------------------------------------------------

# Done
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Wivelrod on July 28, 2007, 09:33:53 AM
This seems to be a compatibility bug in TP and the platform my chosen web host chooses to run. I can't change host, and I can't make my host run a different version of mySql.

I've therefore hacked the TP php page to allow me to add TP articles and categories.

The problem seems to lie in that inserting data into a mySQL Table that has columns that disallow nulls, but have defaults, mySQL will throw an error stating there is no default value for those columns if they haven't been provided in the INSERT statement (despite there being defaults in the table scripts). I've therefore had to change the php file so that INSERTS into tables now include the NOT NULL columns and the default value.

My changed TPortalAdmin.php is attached.

Please, investigate this.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 06:21:51 PM
Hi,

Sorry to bump this thread but I have exactly the same issue as Wivelrod.
I noticed the problem when I first installed SMF/TP and followed all the advice in this forum for rectifying the error, no fixes worked. I reinstalled the site many times always with the same results.

I have now been using SMF/TP for a couple of months and I have managed to work around using articles by utilising the centre blocks. However this is seriously limiting the full potential of TP and I would like to use articles.

Has any progress been made to discover the problem with TP and SQL ?
Is there a version compatibility problem ? (I remember seeing a post where Bloc admits there might be an issue with MySQL 5, but I can't find it now)
Is there a fix for TPortalAdmin.php ? Wivelrod's fix didn't work for me.

My versions: (yes I have recently upgraded to 1.1.4 and followed the fixes described by G6 again)
SMF 1.1.4
TP_0983
PHP Version 5.2.3
MySQL 5.0.45

Error msg when I add a category:
Database Error: Field 'subtype' doesn't have a default value
File: C:\******\Sources\TPortalAdmin.php
Line: 404

Error msg when I add an article:
Database Error: Incorrect integer value: '' for column 'category' at row 1
File: C:\******\Sources\TPortalAdmin.php
Line: 463

Regards & Thanks,
Tim
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on September 30, 2007, 06:57:59 PM
These errors should be fixed after a DB upgrade for both SMF and then TP
So start with updating SMF database and then update TP database tables with the file from the download section
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 07:27:35 PM
OK I've tried to do this again and now I get a problem with the smileys table (I already knew there was a problem with this table as I can't add smiley groups and have to use the default).
I know it's not your problem and I'll have to post this in SMF forum but here it is anyway, just incase you know what the fix is, I'm stuck in maintenance mode now and can't get to admin login screen:

Updating Settings.php... Successful.
Updating and creating indexes...
    Updating indexes on "messages"... done.
    Updating table indexes... done.
    Reordering boards and categories... done.
    Updating indexes and data on "smileys"... Unsuccessful!
This query:

    ALTER TABLE smfukdk_smileys
    ORDER BY LENGTH(code) DESC;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LENGTH(code) DESC' at line 2


off to SMF I go bbs o/
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on September 30, 2007, 07:43:04 PM
These database tables is SMF tables, you have to ask over at SMF forums for help on your error there.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 07:56:30 PM
Yep I know, I found a fix there, had to modify source files and upgrade sql file http://www.simplemachines.org/community/index.php?topic=178857.0 (http://www.simplemachines.org/community/index.php?topic=178857.0)

OK I did the upgrade for SMF (successfully this time) and for TP as instructed many times before on this forum and performed many times by myself :)

    * Upshrink table exists
    * Settings table exists
          o Updated version to 098
    * Blocks table exists
          o Changed pos in blocks table
          o Changed pos in blocks table
    * Variables table exists
          o Changed value5 in variables table
    * Articles table exists
          o Updated body in articles table
    * DL manager table exists
          o Updated file counts in DL Manager table
    * Shoutbox table exists
    * UTF-8 setting is found.
          o Converted articles table for utf-8
          o Converted settings table for utf-8
          o Converted blocks table for utf-8
          o Converted variables table for utf-8
          o Converted dlmanager table for utf-8

TinyPortal´s table structure is now installed/updated.

The error message stating databases are the wrong version has now gone but the other errors remain:

When adding an article in no category:
Incorrect integer value: '' for column 'category' at row 1
File: C:\Webroot_UKDK\Sources\TPortalAdmin.php
Line: 463

When adding a new category:
Field 'subtype' doesn't have a default value
File: C:\Webroot_UKDK\Sources\TPortalAdmin.php
Line: 404

What is strange now after the upgrades, if I list the Categories I can see the test category I did before the upgrades (which I couldn't see before). I can add articles to that one but I can't create new categories.

It looks like I'm getting somewhere, any ideas ?? (I'm looking forward to using articles, i r excited hehe)

cheers for help.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on September 30, 2007, 08:33:23 PM
The only think i can think of is that it have some thing to do with the utf8 langauge settings.
I will have to ask you to wait for Bloc to give you help with this cause I dont know where to look from here.
I know that an upgrade of the SMF tables usually sort this error out, but it seems like somethings still buggering up.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 09:14:43 PM
Hmm interesting you should say that because I have another problem now - the TP admin pages are blank, white with nothing on, I've been searching forum for similar errors and they all seem to specify language files as the problem.

I'm just trying to fix that now - maybe it will kill 2 birds with 1 stone.

Any instructions for fixing language? I have uploaded all the TP files again and the language files but problem remains. I'll try the SMF core language files again..

Cheers.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: IchBin on September 30, 2007, 09:16:08 PM
The TP admin pages are blank? The whole page? Or just the block with the links to each section in the TP admin?
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 09:26:15 PM
The TP links are on the admin page but when I click them I get a blank page returned.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on September 30, 2007, 09:44:05 PM
Read the sticky topic in the install board "missing admin text" or what it was named.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on September 30, 2007, 09:55:30 PM
Yeh, I already checked that. I tried using utf8 language files and saw the TP admin links disappear, when I selected English again they returned. This doesn't affect the blank white page problem when I select a TP admin link.

If anyone needs access to the site let me know.

Oh and btw the link on your site for TP English-UTF8 is 0kb
http://www.tinyportal.net/index.php?action=tpmod;dl=item802 (http://www.tinyportal.net/index.php?action=tpmod;dl=item802)

Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: IchBin on October 01, 2007, 03:40:51 AM
Thanks for the heads up. I've PM'd the user about the UTF8 english files.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 01, 2007, 06:01:06 PM
I tried accessing my TP admin using IE (I usually use FF) and I could see the error message..

PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1572864 bytes) in C:\*****\Sources\Load.php(1735) : eval()'d code on line 1224

I am attempting to adjust the php ini file now to increases the memory allocation, I'll let you know if it fixes the error, and if I still have the article problem.

Thanks,
Tim
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 01, 2007, 06:19:23 PM
OK the memory increase to 16M fixed the blank screen error.

The article problem still remains.

If I try and add a new category the site doesn't return an error but just says 'waiting for www.......' constantly and doesn't time out.

If I try and add an article in no category I get this error:

Incorrect integer value: '' for column 'category' at row 1
File: C:\*****\Sources\TPortalAdmin.php
Line: 463

If I try and add an article to a category that is already there (default from installation) they work fine.

I'm 50% further forward now (I couldn't add articles before) but it's not perfect. Any ideas what could be wrong?

Thanks,
Tim
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on October 01, 2007, 06:23:50 PM
Just to narrow out the language issue, can you set the db and the forum and tp to use iso instead of utf8 and see if it helps.
Convert the db through your admin SMF admin panel and then set the forum to use the english and not english utf8 in admin/settings
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 01, 2007, 06:47:12 PM
Sorry, I can't find those options.
The only language options I can see are:

Convert HTML-entities to UTF-8 characters (in Forum Maintenance - General Maintenance)

and

Default Forum Language (Server Settings - Core Configuration)

Do you have a link to instructions for this procedure or can you explain..

Thanks.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on October 01, 2007, 07:22:36 PM
I think we have found the error, if your administration says you can convert the forum to uft8 it means the forum is running non utf when your db asks for utf8.
So please click the option about convert the forum to utf8 and see if things starts to work ok.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 01, 2007, 07:56:17 PM
OK, I chose 'Convert HTML-entities to UTF-8 characters'
This option has always been there, I have clicked it a few times in the past, and it always remains after using it.

Now when I add an category it doesn't hang but I get the error  message:

Field 'subtype' doesn't have a default value
File: C:\Webroot_UKDK\Sources\TPortalAdmin.php
Line: 404

and if I try adding an article as before I get same error.

By the way, in MySQL it says MySQL charset:  UTF-8 Unicode (utf8)
and the Collation for all tables is  latin1_swedish_ci
is this correct/normal ?

Thanks for reading my posts.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 02, 2007, 05:04:29 PM
OK I fixed the adding an article to no category error, by following these instructions:

http://www.tinyportal.net/index.php?topic=13328.0 (http://www.tinyportal.net/index.php?topic=13328.0)

I now just have this error when adding a new category:
Database Error: Field 'subtype' doesn't have a default value
File: C:\Webroot_UKDK\Sources\TPortalAdmin.php
Line: 404

I tried to fix it following the example above by adding
if(empty($catp))
  $catp = 0;

before line 404:
db_query("INSERT INTO {$tp_prefix}variables (value1,value2,value3,type,value4,value5) VALUES('$catn','$catp','','category','',0)", __FILE__, __LINE__);

but it didn't help and causes a hang instead of the error.

Any ideas or links on this forum to fix this, I searched but couldn't find any.

Cheers
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on October 02, 2007, 05:50:55 PM
I have been searching a lot on this now.
For most a DB upgrade fixes the issue with that error, but then i found this topic.
Can you please read and try and give the info asked of that member there.
http://www.tinyportal.net/index.php?topic=15331.10
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: splattercaster on October 02, 2007, 07:48:54 PM
Yeh, I'd already read that thread mate. The one where bloc quotes
QuoteYes, its def. MySQL5 or PHP5 trouble. I will work out a fix for you on that pending newer versions of TP.

And unfortunately I can't upgrade php or SQL on the server as tcwright suggests as it hosts multiple websites & forums and would probably cause problems.

I guess information about the correct table attributes would be useful then I can modify them to correct the issue.

Thanks for looking though.  :up:
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: Kronos on June 25, 2008, 11:42:52 PM
Hello, I've just successfully manualy installed tinyportal on my SMF board.
Now I've got the same problems as the previous posters in this topic so I thought I'd bump it.

When I try to add an article category it gives the following error:
Field 'subtype' doesn't have a default value
File: ...\SMF\Sources\TPortalAdmin.php
Line: 404


And when I attempt to add an article to one of the allready existing demo categories:
Field 'shortname' doesn't have a default value
File: ...\SMF\Sources\TPortalAdmin.php
Line: 463


I haven't encountered any other errors so far but if I do I'll post them.

Thanks in advance.

Also I'd like to tell you that I'm not particulary good with php, this might make it a bit harder.
Title: Re: "subtype" has no default value error message (SMF 1.1.3, TP 0983)
Post by: G6Cad on June 26, 2008, 09:40:20 AM
You installed what inside what ?
Start a new topic and refer to this topic, but we still need to know your setup according to the posting guidelines.  ;)