Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Hootowls on September 08, 2019, 06:08:23 PM

Title: topic_note error; database not updated?
Post by: Hootowls on September 08, 2019, 06:08:23 PM
Hello! Whenever my members try to post, the following error is received:
Field 'topic_note' doesn't have a default value
File: /home/bearbone/public_html/Sources/Subs-Post.php
Line: 1828

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.12. The above error might possibly go away if you execute the latest version of upgrade.php.


How do I execute upgrade.php? Is there a certain code I need to know for that? Any help would be greatly appreciated! <3
Title: Re: topic_note error; database not updated?
Post by: Hootowls on September 08, 2019, 08:19:14 PM
With further research, this stems from the "Topic Note" mod, but...that's uninstalled? It hasn't been on the forum in a long time, if ever

Version Information:
Forum version: SMF 2.0.15 (more detailed)
Current SMF version: SMF 2.0.15
GD version: bundled (2.1.0 compatible)
Database Server: MariaDB
MySQL version: 10.3.17-MariaDB-log-cll-lve
PHP: 7.0.33
Server version: LiteSpeed

When viewing the more detailed of my forum version, I noticed that index.english-utf8.php is in red since it's 2.0.12. Is that the problem?

And on line 1828:
");"
But around it, it's:
Code: [Select]
array(
$topicOptions['board'], $topicOptions['id'], $posterOptions['id'], $msgOptions['subject'], $msgOptions['body'],
$posterOptions['name'], $posterOptions['email'], time(), $posterOptions['ip'],
$msgOptions['smileys_enabled'] ? 1 : 0, '', $msgOptions['icon'], $msgOptions['approved'],
),
array('id_msg')
);
$msgOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}messages', 'id_msg');

// Something went wrong creating the message...
if (empty($msgOptions['id']))
return false;

// Fix the attachments.
if (!empty($msgOptions['attachments']))
$smcFunc['db_query']('', '
UPDATE {db_prefix}attachments
SET id_msg = {int:id_msg}
WHERE id_attach IN ({array_int:attachment_list})',
array(
'attachment_list' => $msgOptions['attachments'],
'id_msg' => $msgOptions['id'],
)
);

edit;; the error changed to
Field 'topic_note' doesn't have a default value
File: /home/bearbone/public_html/Sources/Subs-Post.php
Line: 1827

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.12. The above error might possibly go away if you execute the latest version of upgrade.php.
Title: Re: topic_note error; database not updated?
Post by: shawnb61 on September 08, 2019, 10:34:33 PM
Most mods do not remove database components upon de-install.  Looks like you have a custom column left over from that mod.

So...   Either remove the unneeded column, or, give it a default value.  You can give it a default value using phpmyadmin.
Title: Re: topic_note error; database not updated?
Post by: Hootowls on September 08, 2019, 10:36:47 PM
By any chance do you know what the custom column is called? I tried searching for it in phpMyAdmin earlier (I found older threads regarding this issue), but no luck
Title: Re: topic_note error; database not updated?
Post by: shawnb61 on September 08, 2019, 10:45:56 PM
From the error message: topic note.  Give it a default value.
Title: Re: topic_note error; database not updated?
Post by: Hootowls on September 08, 2019, 10:56:48 PM
The only thing I found regarding topic_note is "allow_topic_note" in the table search under columns. Do I just type default in the value box, or is there a certain thing I have to do? The box is blank, and the operator dropdown is =

(Sorry for being slow btw!! I'm very not used to this stuff, but your help is super duper appreciated!)
Title: Re: topic_note error; database not updated?
Post by: Hootowls on September 08, 2019, 11:19:23 PM
Wait, no, I got it! I was looking in the wrong table, for some reason it was under "messages"?

Thank you for the help, dude!!
Title: Re: topic_note error; database not updated?
Post by: shawnb61 on September 09, 2019, 01:28:31 AM
Excellent!  Glad it worked out!