News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Another database error when trying to create a new board

Started by beartest, April 07, 2020, 11:37:00 AM

Previous topic - Next topic

beartest

Field 'sort_order' doesn't have a default value
File: /home/customer/www/******com/public_html/Sources/Subs-Boards.php
Line: 784


I am getting this error when I try to create a new board.

// Insert a board, the settings are dealt with later.
$smcFunc['db_insert']('',
'{db_prefix}boards',
array(
'id_cat' => 'int', 'name' => 'string-255', 'description' => 'string', 'board_order' => 'int',
'member_groups' => 'string', 'redirect' => 'string',
),
array(
$boardOptions['target_category'], $boardOptions['board_name'] , '', 0,
'-1,0', '',
),
array('id_board')
);
$board_id = $smcFunc['db_insert_id']('{db_prefix}boards', 'id_board');

if (empty($board_id))
return 0;



Line 784 is array('id_board')


any ideas?



shawnb61

sort_order is not a column name in SMF.  My first thought here is that this is used by a mod?

What mods do you have installed?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

beartest

I had a mod installed, custom board sort.

https://custom.simplemachines.org/mods/index.php?mod=382

But i uninstalled it.

If we uninstall it, shouldn't the functionality that they offer go away with it?

If it doesn't, what can I do now to solve this problem

shawnb61

Most mods do not remove columns from the database upon uninstall. 

They all assume you are likely going to reinstall, and want to keep the prior settings & values.

So this mod does not provide a default value for that column. 

Two options:
- If you really don't want the mod, then go into the database in phpadmin & "drop" that column from the boards table. 
- If you would like the mod back, update the definition of that column in phpadmin.  Give it a default value.  NULL will probably work - it usually does when we see this. 

Hope this helps,
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

beartest


Advertisement: