TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: Maxâ„¢ on April 08, 2010, 10:04:17 AM

Title: [bugtracker] database errors
Post by: Maxâ„¢ on April 08, 2010, 10:04:17 AM
getting errors after i create a new block and try to change it to other block types,  there is old topics about this for previous versions.

index.php?action=tpadmin
Database Error: Out of range value adjusted for column 'pos' at row 1

UPDATE smf_tp_blocks SET pos = 130 WHERE id = 22
Apply Filter: Only show the errors from this file
File: Sources/TPortalAdmin.php
Line: 2260


?action=tpadmin
Database Error: Incorrect integer value: '' for column 'var3' at row 1

UPDATE smf_tp_blocks SET var3 = '' WHERE id = 28
File: Sources/TPortalAdmin.php
Line: 2371
Title: Re: [bugtracker] database errors
Post by: bloc on April 08, 2010, 08:44:18 PM
Which blocktype did you change from - and to what type?
Title: Re: [bugtracker] database errors
Post by: Max on April 08, 2010, 10:18:41 PM
It happens when you add a new block, leaving the title field empty clicking save, when you go back to tp admin blocks section, the block that has "-no title-".  when you try changing the Type to something else, the Database Error: Out of range value adjusted for column 'pos' shows and when you try changing the name of "-no title-" to something else, it saves the name fine but the same error shows.
Title: Re: [bugtracker] database errors
Post by: bloc on April 09, 2010, 08:45:44 AM
I cannot reproduce this, so I am thinking something in database isn't updated from beta4. Possibly the "pos" column in articles table, which should be a INT NOT NULL type.
Title: Re: [bugtracker] database errors
Post by: Max on April 09, 2010, 11:42:03 PM
fixed it in the database to INIT default none
- it worked fine afterwards.

its same so for article categorys.. when you go and create a blank category and click submit, a similar database errors shows up.

Database Error: Incorrect integer value: '' for column 'subtype2' at row 1
INSERT INTO smf_tp_variables
(value1, value2, value3, type ,value4, value5, subtype,value7, value8, subtype2, value9)
VALUES('','0','','category','',0,'','',0,'','')
File: Sources/TPortalAdmin.php
Line: 2044


changed the subtype2 to TinyText Null and it sorted that error also.  :)
Title: Re: [bugtracker] database errors
Post by: bloc on April 20, 2010, 06:24:51 PM
Changing it to TinyTEXT is actually wrong, it should be INT, but the code should have supplied a 0 in the call.

These are both fixed for TP v1.0 beta5.2.
Title: Re: [bugtracker] database errors -Alternate Fix
Post by: CERDIP2 on August 27, 2010, 08:16:34 PM
I had the same problem with creating an article category, using TP v1.0 beta5.2 with SMF 2 RC3.

I found that the VALUES parameters in the query were slightly out of sequence (doesn't take much :-)

So take this from ln# 2051 of sources\TPortalAdmin.php:
VALUES('" . strip_tags($name) . "','".$parent."','','category','',0,'','',0,'','')", __FILE__, __LINE__);

and change it to this:
VALUES('" . strip_tags($name) . "','".$parent."','','category','',0,'','','',0,'')", __FILE__, __LINE__);

and now it works, no mucking with db tables & such :-)