Jake B.
Well-known member
- Affected version
- 2.0.4
XF\Db\InvalidQueryException: MySQL statement prepare error [1101]: BLOB, TEXT, GEOMETRY or JSON column 'view_user_groups' can't have a default value in src/XF/Db/AbstractStatement.php at line 212
- XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
- XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
- XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
- XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
- XF\Db\AbstractAdapter->query() in src/XF/Db/Schema/AbstractDdl.php at line 151
- XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 143
- XF\Db\SchemaManager->alterTable() in src/addons/XFMG/Setup.php at line 644
- XFMG\Setup->upgrade902000010Step3() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 122
- XFMG\Setup->upgradeStepRunner() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 71
- XFMG\Setup->upgrade() in src/XF/Admin/Controller/AddOn.php at line 449
- XF\Admin\Controller\AddOn->actionUpgrade() in src/XF/Mvc/Dispatcher.php at line 249
- XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
- XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
- XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1894
- XF\App->run() in src/XF.php at line 328
- XF::runApp() in admin.php at line 13
Seems to be coming from this portion:
PHP:
if (!$sm->columnExists('view_user_groups', 'xf_mg_category'))
{
$sm->alterTable('xf_mg_category', function(Alter $table)
{
$table->addColumn('view_user_groups', 'blob')->setDefault('a:1:{i:0;i:-1;}')->after('category_description');
});
}
AFAIK
blob
fields cannot be assigned a default value, and removing that default value seems to resolve the issue