After upgrade to 2.1.1 from 2.0.19 I get this when attempting to post new
QuoteField 'ua_os' doesn't have a default value
File: /var/www/vhosts/xxxx.net/yyyy.net/forum/Sources/Subs-Post.php
Line: 1896
I check Subs-Post.php line 1896:
Quote1891 // Insert the post.
1892 $msgOptions['id'] = $smcFunc['db_insert']('',
1893 '{db_prefix}messages',
1894 $message_columns,
1895 $message_parameters,
1896 array('id_msg'),
1897 1
1898 );
Any clues? thx
Have you installed any mods?
So, give the field a default of NULL by using phpmyadmin in the sql
Quote from: Sir Osis of Liver on April 06, 2022, 10:59:29 PMHave you installed any mods?
This is from the old "log user agent and operating system on posts" mod.
Quote from: Arantor on April 07, 2022, 03:14:52 AMQuote from: Sir Osis of Liver on April 06, 2022, 10:59:29 PMHave you installed any mods?
This is from the old "log user agent and operating system on posts" mod.
Indeed. I have seen posts about this error quite a few times here.
@valis1952, if you are still using this mod, doing what
@Kindred posted above should fix the error. However, if you are not using it anymore, the best course of action imo would be to delete/remove all its fields from the database.
I had a few similar messages after I upgraded to 2.1, just give default null in phpMyAdmin and that should do the trick. ;)
Thanks everyone... Mr Newbie here... I can get to phpMyAdmin, and find the file...
But what do I actually do then?
Thx
https://popsql.com/learn-sql/mysql/how-to-add-a-default-value-to-a-column-in-mysql
Quote from: valis1952 on April 07, 2022, 10:19:42 AMThanks everyone... Mr Newbie here... I can get to phpMyAdmin, and find the file...
It is not a file, but a column/field in the smf_messages table.
Quote from: valis1952 on April 07, 2022, 10:19:42 AMBut what do I actually do then?
Are you still using that mod? If yes, at the smf_messages, go the structure, select the ua_os filed and click the edit button. Next step would be to untick NOT NULL and save the changes. This will allow said field to have a null default value and it will make the error go away.
However, if you are not using the mod anymore, which has added that field, the best course of action imo would be to delete/remove said field altogether from the database. There is no point in cluttering your database with fields/tables left behind from old unused mods.
Hope it helps.
Okay. Thanks to everyone who replied. Mission accomplished!
Glad to hear that it got solved.