When adding a new company in Blesta, an error is encountered before the action completes:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'staff_group_id' cannot be null on line 124 in path/to/blesta/lib/model.php
Printing Stack Trace:
#0 path/to/blesta/lib/model.php(124): PDOStatement->execute(Array)
#1 path/to/blesta/components/record/record.php(225): Model->query('INSERT INTO `st...', Array)
#2 path/to/blesta/app/models/staff.php(108): Record->insert('staff_group')
#3 path/to/blesta/public_html/app/controllers/admin_system_companies.php(87): Staff->assignGroup('1', NULL)
#4 path/to/blesta/public_html/lib/dispatcher.php(111): AdminSystemCompanies->add()
#5 path/to/blesta/public_html/index.php(21): Dispatcher::dispatch('path/to/blesta/...')
#6
{main}
See http://www.blesta.com/forums/index.php?/topic/4040-addon-company-sql-error-modelphp/