Database Error: Field 'join_reason' doesn't have a default value

Started by NFG, June 21, 2019, 02:05:20 AM

Previous topic - Next topic

NFG

It seems like the upgrade to 2.1 may have left some detritus behind.  I suspect I used to have a mod asking for a 'join reason', but I don't know for sure where it's getting this from.  Attempts to register new users result in an error shown to the user, and the following error in the admin log:

Database Error: Field 'join_reason' doesn't have a default value
https://<domain>/forum2/index.php?action=signup2
/var/www/forum2/Sources/Subs-Members.php (Line 712)


I didn't see any offending code on line 712, so I checked out the database.  Turning off 'not null' on that column solved the problem. 


@rjen

The join reason mod (https://custom.simplemachines.org/mods/index.php?mod=2326) adds that column to the members table but does not adhere to the stricter MySQL rules...

If you are no longer using the mod you can delete the column from the table altogether...


$column = array(
'name' => 'join_reason',
'type' => 'tinytext',
);

$smcFunc['db_add_column']('{db_prefix}members', $column);
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

NFG

Thanks @rjen, I deleted that column and nothing exploded.  =)

Advertisement: