XF 2.1 I'm getting a strange error when updating email preferences after updating 1.5 to 2.1

SIneDave

Member
When i'm in the user preferences pane and attempt to adjust my email preferences to always receive email notifiations, I get the below error:

1587585138537.webp

1587585095507.webp
Code:
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'dpp_custom_config' in 'field list' in src/XF/Db/AbstractStatement.php at line 228
[LIST=1]
[*]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 94
[*]XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 322
[*]XF\Db\AbstractAdapter->update() in src/XF/Mvc/Entity/Entity.php at line 1468
[*]XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1195
[*]XF\Mvc\Entity\Entity->save() in src/XF/Mvc/Entity/Entity.php at line 1213
[*]XF\Mvc\Entity\Entity->save() in src/XF/Mvc/FormAction.php at line 69
[*]XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 187
[*]XF\Mvc\FormAction->run() in src/XF/Pub/Controller/Account.php at line 312
[*]XF\Pub\Controller\Account->actionPreferences() in src/addons/AVForums/PrefixEssentials/XF/Pub/Controller/Account.php at line 19
[*]AVForums\PrefixEssentials\XF\Pub\Controller\Account->actionPreferences() in src/XF/Mvc/Dispatcher.php at line 350
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2184
[*]XF\App->run() in src/XF.php at line 391
[*]XF::runApp() in index.php at line 20
[/LIST]

Not sure if this is a stock XF error, or part of @Xon 's user essentials add-on we use.

Any ideas?
 
It’s caused by an add-on that you may have had enabled in 1.5 that changed the database to add a field that doesn’t have a default value and now there isn’t any code setting that value it now errors.

You will either need to enable that add-on, seek support of the developer on how to fix that issue or simply remove that field from the database.

Unfortunately it isn’t clear which table this field is in but it is likely to be one of the xf_user tables.
 
Thanks Chris. I tried dropping the column, as you suggested but it's still giving an error. I assume it's referenced somwhere else.

Code:
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'dpp_custom_config' in 'field list' in src/XF/Db/AbstractStatement.php at line 228
[LIST=1]
[*]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 94
[*]XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 322
[*]XF\Db\AbstractAdapter->update() in src/XF/Mvc/Entity/Entity.php at line 1468
[*]XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1195
[*]XF\Mvc\Entity\Entity->save() in src/XF/Mvc/Entity/Entity.php at line 1213
[*]XF\Mvc\Entity\Entity->save() in src/XF/Mvc/FormAction.php at line 69
[*]XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 187
[*]XF\Mvc\FormAction->run() in src/XF/Pub/Controller/Account.php at line 312
[*]XF\Pub\Controller\Account->actionPreferences() in src/addons/AVForums/PrefixEssentials/XF/Pub/Controller/Account.php at line 19
[*]AVForums\PrefixEssentials\XF\Pub\Controller\Account->actionPreferences() in src/XF/Mvc/Dispatcher.php at line 350
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2184
[*]XF\App->run() in src/XF.php at line 391
[*]XF::runApp() in index.php at line 20
[/LIST]

I was able to grab the blob from one user who had it set, and it appears to be a posts per page preference in BLOB format: {"threads":20,"posts":20,"conversations":20}

Any ideas where I can track down the source of the column reference?
 
Strangely I actually misread the error as something else. But, still, the column isn’t a default column so it has been added by an add-on. In this case it’s saying it’s an unknown column, so it means there is code that expects the column to exist but it doesn’t.

You would have to try and figure out which add-on it comes from and seek support from its developer.

I suspect that disabling the problematic add-on should make the error go away so that should help identify which it is.
 
Ok, making some progress. Paging @truonglv - I think it's your code.

[21:40][root@xf.hometheaterforum.com community]# grep -rlw -e "dpp_custom_config" /home/nginx/domains/hometheaterforum.com/public/community/
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/XF/Entity/UserOption.php
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/XF/Pub/Controller/Account.php
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/Listener.php
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/Job/Migrate206.php
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/Setup.php
/home/nginx/domains/hometheaterforum.com/public/community/src/addons/Truonglv/DiscussionsPerPage/Callback.php
[21:43][root@xf.hometheaterforum.com community]#
 
Top Bottom