Solved: 6 Months, 2 Days ago SQL Error: 1364 - Field 'defaultmessage_thread' doesn't have a default value
#1
Solved: 6 Months, 2 Days ago
Hi to all,

I am in need of help after a server migration.
Everything, so far, seemed to be ok except an error that showed up when I was making a child forum

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1364 - Field 'defaultmessage_thread' doesn't have a default value

Query:
INSERT INTO mybbvb_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 ('Other Plugins','','','f',65,'',3,1,1,0,1,1,1,1,1,1,1,1,0,'',1,0,0,0,'','',0,'','') 
Please contact the MyBB Group for technical support.



BTW I have got a few plugins but most were customized and I know that if I disable any I will probably have issues trying to reactivate it

How can I solve this, any ideas?

Thank You
Klaus
Reply
#2
Solved: 6 Months, 2 Days ago
This error is because you enabled this plugin but the required field is not in the table.
now you must re-enable plugin or delete plugin or add field manually
Create Web,Windows Software Mybb,Wordpress Plugin/theme
How Oder new Project?
Reply
#3
Solved: 6 Months, 2 Days ago
Thank you Mostafa,

Deactivating a re-enabling a plugin on the forum usually gets me into trouble.

I got the php file open, can you please help me by telling me what field shall I add Manually and where.
Sorry to ask but I am not MyBB proficient at all.

Thank you very much
Klaus
Reply
#4
Solved: 6 Months, 2 Days ago
(2021-01-13, 01:26 PM)KlausT Wrote: Thank you Mostafa,

Deactivating a re-enabling a plugin on the forum usually gets me into trouble.

I got the php file open, can you please help me by telling me what field shall I add Manually and where.
Sorry to ask but I am not MyBB proficient at all.

Thank you very much
Klaus
Run below query on phpmyadmin
	ALTER TABLE forums ADD defaultmessage_prefix smallint unsigned NOT NULL default "0";
	ALTER TABLE forums ADD defaultmessage_subject varchar(120) NOT NULL default "";
	ALTER TABLE forums ADD defaultmessage_thread text NOT NULL;
	ALTER TABLE forums ADD defaultmessage_post text NOT NULL;
	ALTER TABLE threadprefixes ADD defaultmessage_prefix_subject text NOT NULL;
	ALTER TABLE threadprefixes ADD defaultmessage_prefix_thread text NOT NULL;
	ALTER TABLE threadprefixes ADD defaultmessage_prefix_post text NOT NULL;

every line add one field, check fields that not exist  then run query of fields
Create Web,Windows Software Mybb,Wordpress Plugin/theme
How Oder new Project?
Reply
#5
Solved: 6 Months, 2 Days ago
I have tried to deactivate and activate the Admin Notice plugin but that did not work

Can anyone help me by telling me if the above changes can get done on defaultmessage.php file
I am not used to changing anything on phpMyAdmin

defaultmessage.php has this code, is it possible to change things here

	$db->add_column("forums", "defaultmessage_prefix", "smallint unsigned NOT NULL default \"0\"");
	}
	
	if(!$db->field_exists("defaultmessage_subject", "forums"))
	{
		$db->add_column("forums", "defaultmessage_subject", "varchar(120) NOT NULL default \"\"");
	}
	
	if(!$db->field_exists("defaultmessage_thread", "forums"))
	{
		$db->add_column("forums", "defaultmessage_thread", "text NOT NULL");
	}
	
	if(!$db->field_exists("defaultmessage_post", "forums"))
	{
		$db->add_column("forums", "defaultmessage_post", "text NOT NULL");

Thank you in advance to anyone who may help me for free

My Best
Klaus T
Reply
#6
Solved: 6 Months, 2 Days ago
Those errors seem to relate to issues that may be solved by disabling strict mode for mysql. A guide to do this would be - https://www.knowledgebase-script.com/kb/...l-163.html but it may vary depending on your specific set up.
-Ben

Please do not PM me for support. I am looking to be hired for paid services.

You can view my paid services here.
Reply
#7
Solved: 6 Months, 2 Days ago
(2021-01-15, 05:33 PM)Ben Wrote: Those errors seem to relate to issues that may be solved by disabling strict mode for mysql. A guide to do this would be - https://www.knowledgebase-script.com/kb/...l-163.html but it may vary depending on your specific set up.

Hi Ben, thank you for reaching out to help,
the link you have sent gives me a 404

On the 'Default Message' plugin error, it must be an incompatibility of some sort.
Deactivating it didn't solve it but after removal, everything worked as it should.

Thank you to all who tried to give some hints to solve things

Klaus
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)