Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Linzmeister on August 15, 2018, 10:42:28 PM

Title: Error creating new posts
Post by: Linzmeister on August 15, 2018, 10:42:28 PM
Error message:
Field 'is_solved' doesn't have a default value
File: /home/goodson/public_html/forum/Sources/Subs-Post.php
Line: 1852

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while
your database is at version 2.0.2. The above error might possibly go away if you execute the latest version of upgrade.php.


Server version #s
• cpsrvd 11.74.0.4
• Database client version: libmysql - 5.1.73
• PHP version: 5.6.30

server located at  http://www.forum.goodson.com.au
Guest posts are restricted to the Ask A Question board, but it gives a different error message than when I am logged in.


I did find:
http://www.simplemachines.org/community/index.php?topic=336967.0
and
https://www.simplemachines.org/community/index.php?topic=288665.0
which have the same error message, but I can't make sense of the answers.

I can not find any table with an is_solved field to be able set the default value as per the first solution above.

I uninstalled the Topic_Solved Mod, but the error persists. 
I re-installed the Mod and the error persists.
Looking at the install script, it doesn't make any changes to Subs-Post.php where the error is reported.

I have looked at the Subs-Post.php and there is no reference to is_solved either in the COLUMNS or VALUES arrays in the function before line 1852.

$smcFunc['db_insert']('',
'{db_prefix}topics',
array(
'id_board' => 'int', 'id_member_started' => 'int', 'id_member_updated' => 'int', 'id_first_msg' => 'int',
'id_last_msg' => 'int', 'locked' => 'int', 'is_sticky' => 'int', 'num_views' => 'int',
'id_poll' => 'int', 'unapproved_posts' => 'int', 'approved' => 'int',
),
array(
$topicOptions['board'], $posterOptions['id'], $posterOptions['id'], $msgOptions['id'],
$msgOptions['id'], $topicOptions['lock_mode'] === null ? 0 : $topicOptions['lock_mode'], $topicOptions['sticky_mode'] === null ? 0 : $topicOptions['sticky_mode'], 0,
$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'],
),
array('id_topic')
);


Additionally I don't have a table called forum_topics..  "forum_" being my db_prefix..

In fact searching through Subs-post.php where db_prefix occurs, makes me think many of my database tables are missing.:
permissions
personal_messages
pm_recipients
settings
topics

See attached screen shots of the table listing
It's looks like all tables alphabetically after forum_moderators don't exist, unless I am reading the php completely wrong.


Looking into the log files MOD httpBL (blacklisting spam prevention) has issues writing to the database too:


Error screen shot:

http://www.forum.goodson.com.au/index.php?action=register
Field 'error' doesn't have a default value
/home/goodson/public_html/forum/Sources/httpBL_Subs.php
Line: 299


282: // Do it 2.0 way
283: $time = time();
284: $smcFunc['db_insert']('insert',
285: '{db_prefix}log_httpBL',
286: array(
287: 'logTime' => 'int', 'ip' => 'string', 'threat' => 'int', 'last_activity' => 'int',
288: 'suspicious' => 'int', 'harvester' => 'int', 'comment' => 'int', 'url' => 'string',
289: 'user_agent' => 'string', 'errorNumber' => 'int', 'username' => 'string',
290: 'raw' => 'string', 'stopped' => 'int'
291: ),
292: array(
293: $time, $ip, $threat, $last_activity,
294: $suspicious, $harvester, $comment, $url,
295: $user_agent, $errorNumber, $username,
296: $raw, $stopped
297: ),
298: array()
==>299: );

There is no Table called forum_log_httpBL for an error field to exist in.

Could I really be missing complete tables???

Any assistance greatly appreciated.
Title: Re: Error creating new posts
Post by: Kindred on August 16, 2018, 09:45:35 AM
SO, this error has to do with the mod and the version of mySQL that you are running.

At some point, mySQL introduced an error into their code which forced "STRICT MODE" on, regardless of the server settings. They then fixed this after several versions.

So, your fix is one of three options.
1- if STRICT MODE is defined as ON (for your server - check with your host) and you are not on one of the error-versions of mySQL, then ask your host to turn it off.
2- If you are on one of the error-versions, ask your hist to upgrade mySQL to a version that fixed this error.
3- Make the column have a default value

I think the field is in the topics table....


ALTER TABLE `smf_topics`
ALTER `is_solved` SET DEFAULT NULL;
Title: Re: Error creating new posts
Post by: Linzmeister on August 16, 2018, 10:52:27 PM
Thank you for your reply.

I asked our web site host to disable Strict Mode and it is working now.

HA!! I found the "missing tables" ...


:'( :-\ :o :-X ::) by clicking next page in phpMyAdmin  ::) :-X :o :-\ :'(

I also set the default of forum_topics  field is_solved as well, just in case our host changes server versions again in the future without telling us ;)
Title: Re: Error creating new posts
Post by: Ronald_1938 on April 24, 2019, 06:16:41 PM
Sorry I do not wish to hijack this thread, but I have the same problem, when posting..

This is my friends forum, and he is not good at doing repairs, guess I'm not neither.

When making a Topic to post I get two (2) errors. Posting in Topics already there is just find, it's just new Topics.

One error is this;
Quote
(https://www.stumpburner.com/forum/Themes/ostara2/images/filter.gif) (https://www.stumpburner.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc;filter=url;value=P2FjdGlvbj1wb3N0MjtzdGFydD0wO2JvYXJkPTY1) https://www.stumpburner.com/forum/index.php?action=post2;start=0;board=65 (https://www.stumpburner.com/forum/index.php?action=post2;start=0;board=65) (https://www.stumpburner.com/forum/Themes/ostara2/images/filter.gif) (https://www.stumpburner.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc;filter=message;value=RGF0YWJhc2UgRXJyb3I6IEZpZWxkICdpc1xfc29sdmVkJyBkb2Vzbid0IGhhdmUgYSBkZWZhdWx0IHZhbHVlPGJyIC8+PGJyIC8+PGJyIC8+CQkJSU5TRVJUIElOVE8gc21mXF90b3BpY3MoYGlkXF9ib2FyZGAsIGBpZFxfbWVtYmVyXF9zdGFydGVkYCwgYGlkXF9tZW1iZXJcX3VwZGF0ZWRgLCBgaWRcX2ZpcnN0XF9tc2dgLCBgaWRcX2xhc3RcX21zZ2AsIGBsb2NrZWRgLCBgaXNcX3N0aWNreWAsIGBudW1cX3ZpZXdzYCwgYGlkXF9wb2xsYCwgYHVuYXBwcm92ZWRcX3Bvc3RzYCwgYGFwcHJvdmVkYCk8YnIgLz4JCQlWQUxVRVM8YnIgLz4JCQkJKDY1LCAxNzc4LCAxNzc4LCAzMzI0MiwgMzMyNDIsIDAsIDAsIDAsIDAsIDAsIDEp)
Database Error: Field 'is_solved' doesn't have a default value


INSERT INTO smf_topics(`id_board`, `id_member_started`, `id_member_updated`, `id_first_msg`, `id_last_msg`, `locked`, `is_sticky`, `num_views`, `id_poll`, `unapproved_posts`, `approved`)
         VALUES
            (65, 1778, 1778, 33242, 33242, 0, 0, 0, 0, 0, 1) (https://www.stumpburner.com/forum/Themes/ostara2/images/filter.gif) (https://www.stumpburner.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc;filter=file;value=L2hvbWUvc3R1bXBidXIvcHVibGljX2h0bWwvZm9ydW0vU291cmNlcy9TdWJzLVBvc3QucGhw)  File: /home/stumpbur/public_html/forum/Sources/Subs-Post.php (https://www.stumpburner.com/forum/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUvc3R1bXBidXIvcHVibGljX2h0bWwvZm9ydW0vU291cmNlcy9TdWJzLVBvc3QucGhw;line=1851)
Line: 1851


Also get this error

QuoteField 'is_solved' doesn't have a default value
File: /home/stumpbur/public_html/forum/Sources/Subs-Post.php
Line: 1851

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while your database is at version 2.0.7. The above error might possibly go away if you execute the latest version of upgrade.php

I also have been in phpmyadmin and looked in smf_topics and there is no is_solved in there either.

His Host is Fasthive, no idea who this is..

At one time he did have a mod called 'Topic Solved', but since has removed it, quite awhile ago.. I have parsed 'Topic Solved' and scanned every file involved, and is_solved is no where to be found, but I did notice in 3 database files I was checking there is missing code, code that should be in there.

Anyone help on this or give me any solutions on correcting this..

Thanks in advance..
Ron.
Title: Re: Error creating new posts
Post by: Ronald_1938 on April 24, 2019, 08:33:13 PM
Solved. He has quite a few databases in there, and I found I was checking the wrong one. When I got the proper database I did find is_solved and changed it to NULL.