News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Error creating new posts

Started by Linzmeister, August 15, 2018, 10:42:28 PM

Previous topic - Next topic

Linzmeister

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  hxxp:www.forum.goodson.com.au [nonactive]
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.

Kindred

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;
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Linzmeister

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 ;)

Ronald_1938

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
Apply Filter: Only show the error messages of this URL https://www.stumpburner.com/forum/index.php?action=post2;start=0;board=65 Apply Filter: Only show the errors with the same message
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) Apply Filter: Only show the errors from this file  File: /home/stumpbur/public_html/forum/Sources/Subs-Post.php
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.

Ronald_1938

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.

Advertisement: