Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: maav on August 22, 2019, 02:10:23 PM

Title: Error - sent messages
Post by: maav on August 22, 2019, 02:10:23 PM
After typing a reply in the post, SMF writes me an error:

Field 'hiddenInfo' doesn't have a default value
File: /home/user01443/roomxxx.com/www/Sources/Subs-Post.php
Line: 1817

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


How can I fix it?
Thank you
Title: Re: Error - sent messages
Post by: Kindred on August 22, 2019, 03:03:50 PM
go into the database with phpmyadmin and give that column a default value (usually NULL)
Title: Re: Error - sent messages
Post by: maav on August 22, 2019, 03:37:03 PM
It is set to 0 and probably correct.
There will be no mistake.
Thanks
Title: Re: Error - sent messages
Post by: Kindred on August 22, 2019, 03:57:31 PM
that is untrue....

if the default should be NULL, that is different from a default of 0 and may have very different results.
Title: Re: Error - sent messages
Post by: maav on August 23, 2019, 01:12:07 AM
Thanks.
No. The default value is 0.
Title: Re: Error - sent messages
Post by: a10 on August 23, 2019, 07:03:25 AM
https://www.essentialsql.com/get-ready-to-learn-sql-server-what-is-a-null-value/
Title: Re: Error - sent messages
Post by: Arantor on August 23, 2019, 07:13:12 AM
Quote from: maav on August 23, 2019, 01:12:07 AM
Thanks.
No. The default value is 0.

How did you arrive at that?
Title: Re: Error - sent messages
Post by: maav on August 23, 2019, 03:02:18 PM
I looked at the table.
Thank you
Title: Re: Error - sent messages
Post by: Arantor on August 23, 2019, 03:08:16 PM
*shrug* I still wouldn't make that assumption, even after looking at the table, the only way I'd make that assumption is by looking at and understanding the code. I've seen weirder things where the table nearly always had one value but that it wasn't the default and things broke by making it the default.

The recommendation to make it null is much safer for future reference.
Title: Re: Error - sent messages
Post by: GigaWatt on August 23, 2019, 07:02:53 PM
https://www.oreilly.com/library/view/mysql-cookbook/0596001452/ch08s05.html
Title: Re: Error - sent messages
Post by: Arantor on August 24, 2019, 04:12:53 AM
What do you think phpMyAdmin does under the hood?

Anyway the debate is not "how to set a default" as such, but rather setting an explicit default vs setting no default by way of null.
Title: Re: Error - sent messages
Post by: maav on August 27, 2019, 01:03:28 PM
Kindred is right. I looked at the problem again and the item was not set.
I set up and the error is already OK.
Thank you