MyBB Community Forums

Full Version: SQL Errors creating new Forum/Child Forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Whenever i want to create a new Forum or child forum this error pops up --> error 1364 Field 'xthreads_tplprefix' doesn't have a default value. Nothing i do wants to work. I searched the php files for xthreads_tplprefix database insert but found nothing. In the Xthreads options of creating the forums i add prefixes but still shows the same error. I'm using xthreads 1.63 and MyBB 1.6.13. Is this a bug or what ?
Do you have all the files uploaded for xThreads? Do you have any custom fields that are called tplprefix?


I am running the same combo as you and I can add forums.
Leefish its a fresh install of mybb 1.6.13 and xthreads 1.63, with fresh database aswell. I always load all the files from the plugin zip archive to the correct directories. I dont have any custom fields either. I dont know what is going on .

Here is the whole error
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1364 - Field 'xthreads_tplprefix' doesn't have a default value
Query:
 INSERT INTO mybb_forums (`name`,`description`,`linkto`,`type`,`pid`,`parentlist`,`disporder`,`active`,`open`,`allowhtml`,`allowmycode`,`allowsmilies`,`allowimgcode`,`allowvideocode`,`allowpicons`,`allowtratings`,`usepostcounts`,`password`,`showinjump`,`modposts`,`modthreads`,`mod_edit_posts`,`modattachments`,`style`,`overridestyle`,`rulestype`,`rulestitle`,`rules`,`defaultdatecut`,`defaultsortby`,`defaultsortorder`) VALUES ('Forum B 2','','','f','4','','2','1','1','0','1','1','1','1','1','1','1','','1','0','0','0','0','0','0','0','','','0','','')

the only place i see of a 'xthreads_tplprefix' database query is in, inc/xthreads/xt_upgrader.php . But i'm nowhere near an upgrade of any kind.
> line 108: 
$db->write_query('ALTER TABLE `'.$db->table_prefix.'forums` MODIFY `xthreads_tplprefix` varchar(255) not null default ""');

> line 136:
$db->write_query('ALTER TABLE `'.$db->table_prefix.'forums` MODIFY `xthreads_tplprefix` text not null');

or is there any way of setting a default value in a php file somewhere so the error can go away ?

i reinstalled mybb with xthreads about 15 times now
do you have all the files chmoded correctly? Have you tried asking ZingaBurga at MyBB hacks?
Leefish thank GOD! i finally managed to fix this error !
// in inc/xthreads/xt_install.php i removed all sql queries like this:
'tplprefix' => 'text not null',
'langprefix' => 'text not null',
'defaultfilter' => 'text not null',

// Then replaced that with this:
'tplprefix' => 'varchar(255) default \'\'',
'langprefix' => 'varchar(255) default \'\'',
'defaultfilter' => 'varchar(255) default \'\'', 


Now i can create forums again.
That s great - I wonder why the original insert did not work though. What versions of php and MySQL are you running?
i'm running php 5.4.28 and mysql 5.5.37 . I dunno what went wrong though, but glad its working now.
Interesting - tell ZingaBurga, I saw you were able to post on his board.
Sure i will , mayby he can find a better fix for that error ty.