TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: flyonthenet on April 21, 2007, 10:33:30 AM

Title: Add Category
Post by: flyonthenet on April 21, 2007, 10:33:30 AM
In TinyPortal 0.9.8, I found 2 problems creating a new category (action=tpadmin;sa=addcategory)

- Other categories aren't listed under 'Set as sub-category of'.
- Saving I get the an error

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


subtype isn't set on the query, but the structure of tp_variables table doesn't allow null for this field.
I solved removing 'not null'.
value7 and value8 fields have the same issue.
Title: Re: Add Category
Post by: flyonthenet on April 21, 2007, 10:46:45 AM
I found another similar:

Field 'shortname' doesn't have a default value
File: [..]\Sources\TPortalAdmin.php
Line: 463


I get this by adding a new article. I solved in the same manner.
Title: Re: Add Category
Post by: G6Cad on April 21, 2007, 11:15:42 AM
Those both errors were shown in TP V.097, and are fixed for TP V.098, so there must been some error when you upgraded the forum to V.098.

To fix those (even if you have so manually, but there can be other errors in the DB) download the manual install file DB only and upload and run it from the browser.
Title: Re: Add Category
Post by: flyonthenet on April 21, 2007, 02:35:23 PM
Thank-you, I ran the manual update for TP 098 to fix tables.

Another similar question: I start writing a very long article - really it's copy and paste  ::)

I get this error:

Data too long for column 'body' at row 1
File: [...]\Sources\TPortalAdmin.php
Line: 948


Ok, it's long, it's 140kB and the limit of TEXT fields normally is 64kB.

I alter the 'body' field in MEDIUMTEXT (max 16MB ...) so I can save it.

I suggest you to 'upgrade' this field because 64kB seems a lot of text, but it's easy to overflow writing code examples.

Bye
Title: Re: Add Category
Post by: bloc on April 22, 2007, 03:03:37 PM
Already added..in future versions the article will use LONGTEXT for the body of the article.
Title: Re: Add Category
Post by: ViperX on June 14, 2007, 04:07:46 AM
Hi,

I am getting the same error which was listed orginally in this older thread, i.e. adding catagories or articles. I have tried doing the manual tp database install but that does not correct the problem. I am using smf 1.1.2 and tp 0.983. I have tried several fresh installs with the same results. Can you tell what actaully was corrected in the 0.98 release to fix this issue, so that I might better diagnose why it is not installing properly in my environment?

Thanks
Title: Re: Add Category
Post by: IchBin on June 14, 2007, 04:54:37 AM
Not sure what you're referring to, but Blocs reference to LONGTEXT is the fix that was applied because before it wasn't set to a column type that could hold enough information.
Title: Re: Add Category
Post by: ViperX on June 14, 2007, 02:46:31 PM
Sorry for the lack of clarity...

I was reffering to the two orginal issues listed in the topic for adding catagories and adding articles.
i.e.
Field 'shortname' doesn't have a default value
File: [..]\Sources\TPortalAdmin.php
Line: 463

I am seeing both issues still when I do a clean install( as mentioned smf 1.1.2 and tp0.983) original poster mentioned he was able to fix the issue by removing the not null, but G6 also posted that there could be other errors in the DB. I tried doing the manual_tp install to correct the DB as instructed but the issues persists and I would like to make sure that I correct all possible related issues.

I am currently testing the software in a proto environment in preparation for installing on a live site which is currently running PHPnuke. just want to get all my ducks in a row prior to the change over....

Thanks for any input,
you folks have done and continue to do a great job here!!!
Title: Re: Add Category
Post by: IchBin on June 14, 2007, 10:45:25 PM
I'm wondering if this doesn't have something to do with your MySQL version. Do you have that info? Can you post the results of a phpinfo page please?
http://www.simplemachines.org/community/index.php?topic=18250.0
Title: Re: Add Category
Post by: ViperX on June 15, 2007, 06:07:17 AM
Sorry for the delay,
This is not public server, just a local test server. Windows 2k3 & IIS6 & php5.1.1. My puplic server is hosted elseware and is not windows....

There is alot of info in the phpinfo output, anything in partticular you are looking for???

I found 3 diff My Sql versions listed from
mysql admin-->client version 5.11
phpmyadmin says-->MySQL 5.0.18-nt
phpinfo says-->Client API version  4.1.7 
 
Title: Re: Add Category
Post by: bloc on June 15, 2007, 02:28:43 PM
Yes, its def. MySQL5 or PHP5 trouble. I will work out a fix for you on that pending newer versions of TP.
Title: Re: Add Category
Post by: ViperX on June 15, 2007, 02:40:29 PM
Excellent,
Thank You!
Title: Re: Add Category
Post by: tcwright on July 13, 2007, 04:36:01 PM
I'm receiving a similar error:

Field 'subtype' doesn't have a default value
File: [...]\Sources\TPortalAdmin.php
Line: 434

I've been searching high and low for a resolution of this issue.  I'm getting the same error except different line number (434 instead of 404).  I first received this error when upgrading from SMF 1.1.1 to 1.1.3 and from TP 0.9.7 to 0.9.8.  Below the error message was a database error indicating that I was using the database from SMF 1.1.2 and to perform a manual update to 1.1.3 to fix the problem, which I did - the database error went away but I'm still receiving the subtype error.

I then performed a fresh install reverting back to SMF 1.1.2 w/ TP 0.9.8 and still have the same issue.

I've also followed all of the recommendations from other posts (i.e. performing a manual database install, repairing the database, etc.) with no luck.  When I go in and edit the tp_variables table I see subtype, value7 and value8, and the default value is blank.  I was thinking I can go in and manually edit the default value but I'm not sure what the default value should be.

These were all fresh installs, mind you...  I'm on a Windows 2003 Server machine w/ MySQL 5.0.27-community, and PHP 5.2.0.

Any help would be appreciated.

Regards,
Tom
Title: Re: Add Category
Post by: ViperX on July 13, 2007, 04:47:45 PM
Hi Tom,
I was also having issue as you are. Bloc mention that he thought it was a PHP or  Mysql 5.X issue, but did not mention any details. My live site is on a linux box with older versions and did not have the trouble. I was able to get past those erros in my testing by changing the appropriate TP_???  tables so that they were NOT set to "NOT NULL", which allows NULL entries.
Since there are not that many TP tables perhaps Bloc could just post the correct setting for the tables(if that is the issue). I have no idea if this could cause any other ramifications but give it a shot...

Best Regards,
John   
Title: Re: Add Category
Post by: tcwright on July 13, 2007, 05:04:07 PM
Thanks John, I'll do that and let you know if it works or not.
Title: Re: Add Category
Post by: tcwright on July 13, 2007, 06:18:31 PM
Hey John,

I upgraded from MySQL 5.0.27 to 5.0.45 and upgraded PHP from 5.2 to 5.3, which seemed to fix the issue, just in case this issue comes up again.  I haven't performed any extensive testing, but the Add Catagory issue is resolved.

Thanks,
Tom