Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 SQL Error when creating New Forums/ child forums
jlynx Offline
Junior Member
**
Posts: 4
Joined: Jun 2014
Post: #1
SQL Error when creating New Forums/ child forums
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 ?
06-07-2014 07:18 AM
Find all posts by this user Quote this message in a reply
jlynx Offline
Junior Member
**
Posts: 4
Joined: Jun 2014
Post: #2
RE: SQL Error when creating New Forums/ child forums
Here is the whole error

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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:
1
2
3
4
5
6
7
> 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:
1
2
3
4
5
6
7
> 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');

(This post was last modified: 06-07-2014 06:02 PM by jlynx.)
06-07-2014 05:34 PM
Find all posts by this user Quote this message in a reply
jlynx Offline
Junior Member
**
Posts: 4
Joined: Jun 2014
Post: #3
RE: SQL Error when creating New Forums/ child forums
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
06-07-2014 06:39 PM
Find all posts by this user Quote this message in a reply
jlynx Offline
Junior Member
**
Posts: 4
Joined: Jun 2014
Post: #4
RE: SQL Error when creating New Forums/ child forums
thank GOD! i finally managed to fix this error !

PHP Code:
1
2
3
4
5
6
7
8
9
// 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.

06-07-2014 08:02 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Online
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: SQL Error when creating New Forums/ child forums
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.

My Blog
06-09-2014 10:48 AM
Find all posts by this user Quote this message in a reply
terzier Offline
Member
***
Posts: 91
Joined: Feb 2012
Post: #6
RE: SQL Error when creating New Forums/ child forums
I also experienced the same thing. mybb I used version 1.8.
Yumi please help.

Un-Official MyBB from Indonesia| Facebook Page|Twitter
GARUDA DIDADA KU
08-06-2016 06:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #7
RE: SQL Error when creating New Forums/ child forums
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:
1
2
3
4
5
6
7
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

(This post was last modified: 05-27-2018 03:05 AM by nier3.)
05-26-2018 11:18 AM
Find all posts by this user Quote this message in a reply
Gil Offline
Junior Member
**
Posts: 1
Joined: Nov 2019
Post: #8
RE: SQL Error when creating New Forums/ child forums
in phpMyAdmin, you can execute this SQL request to set the default values of these 4 fields.

Code:
ALTER TABLE `mybb_forums` CHANGE `xthreads_tplprefix` `xthreads_tplprefix` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `mybb_forums` CHANGE `xthreads_langprefix` `xthreads_langprefix` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `mybb_forums` CHANGE `xthreads_settingoverrides` `xthreads_settingoverrides` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `mybb_forums` CHANGE `xthreads_defaultfilter` `xthreads_defaultfilter` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;

Remark : Modify this request if your table is not in utf8...

11-20-2019 07:11 PM
Find all posts by this user Quote this message in a reply
blacksword Offline
Junior Member
**
Posts: 9
Joined: Dec 2016
Post: #9
RE: SQL Error when creating New Forums/ child forums
that's great if you know where to go... in phpmyadmin I cant find the damn thing...
02-18-2022 03:02 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: