MyBB Hacks

Full Version: SQL Error when creating New Forums/ 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 ?
Here is the whole error

PHP Code:
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`
,`activ​e`,`open`,`allowhtml`,`allowmycode`,`allowsmilies`,`
allowimgcode`,`allowvideocod​
e`,`allowpicons`,`allowtratings`,`usepostcounts`,`password`,`
showinjump`,`modpos​ts`,`modthreads`,`mod_edit_
posts`,`modattachments`,`style`,`overridestyle`,`rule​
stype`,`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.

PHP Code:
> 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');


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.

PHP Code:
> 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 20 times now
thank GOD! i finally managed to fix this error !

PHP Code:
// 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.

Does MyBB work with MySQL under strict mode now?
It didn't used to (well, after 1.2.x), so I never bothered doing the same.
I also experienced the same thing. mybb I used version 1.8.
Yumi please help.
Hi, I have this problem, I tried to change in 'varchar(255) default \'\'', file "xt_install.php" but nothing, always error when I try to add a new forum or category Frown

PHP Code:
MyBB SQL 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`,`usethreadcounts`,`requireprefix`,`password`,`showinjump`,`style`,`overridestyle`,`rulestype`,`rulestitle`,`rules`,`defaultdatecut`,`defaultsortby`,`defaultsortorder`) VALUES ('xdfsds','','','f',1,'',2,1,1,1,1,1,1,1,1,1,1,1,0,'',1,0,0,0,'','',0,'','')


I have
MyBB Version 1.8.15
PHP Version 7.1.7
SQL Engine MySQLi 5.7.19

Maybe I have to re-install Xthreads plugin? Frown(((

Thank you

EDIT: I tried to deactivate, uninstall and install again xthreads on a forum test and yes, with new version of xt_install.php (with varchar) now I can add new forums.

The problem is if I uninstall xthreads on my main forum, with all data threads etc I will lost all Frown

Reference URL's