• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Error adding node - MySQL query error [1364]: Field 'rules' doesn't have a default value

#1
I'm getting this error when trying to create a forum node. This was after installing a couple of addons that I've since disabled.

Would greatly appreciate any suggestions on how to resolve, thanks!

Oops! We ran into some problems.
XF\Db\Exception: MySQL query error [1364]: Field 'rules' doesn't have a default value in src/XF/Db/AbstractStatement.php at line 212

  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 174
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 70
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 69
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 146
  5. XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1381
  6. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1113
  7. XF\Mvc\Entity\Entity->save() in src/XF/Mvc/Entity/Entity.php at line 1131
  8. XF\Mvc\Entity\Entity->save() in src/XF/Mvc/FormAction.php at line 69
  9. XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 159
  10. XF\Mvc\FormAction->run() in src/XF/Admin/Controller/AbstractNode.php at line 110
  11. XF\Admin\Controller\AbstractNode->actionSave() in src/XF/Mvc/Dispatcher.php at line 249
  12. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
  13. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  14. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1879
  15. XF\App->run() in src/XF.php at line 328
  16. XF::runApp() in admin.php at line 13
 

Brogan

XenForo moderator
Staff member
#2
This was after installing a couple of addons that I've since disabled.
Disabling the add-on is the cause of the problem - it hasn't been coded correctly so when disabled, causes an error.

Re-enable the add-on or better yet, contact the author and get them to issue a fix.
 

Chris D

XenForo developer
Staff member
#3
Even worse than that, it appears as though they've added a table called "rules" to one of the core node related tables. Although adding new columns to core tables is fine, we do at least ask that they are prefixed with the add-on or developer name to aid in identification and ensure that should we ever add a column of the same name, there won't be a clash.