XF 2.2 Creating users not possible after upgrading from 1.5.x to 2.2.2

Michael_IO

New member
Hi, I've recently upgraded a forum from v1.5.x to 2.2.2. Prior to the upgrade I've uninstalled all add-ons to start fresh with the new installation. The upgrade itself worked fine without any issues but I just noticed that creating users isn't possible anymore, neither the normal registration nor manually creating users.

Another issue I've noticed (but I think it's unrelated to this particular issue) is that on the front end in the widget "Forum Statistics" I see round about 10k users less than in the admin as total user count.

When creating a user it throws this error in the server log:

Code:
XF\Db\Exception: MySQL query error [1364]: Field 'associated_resource_ids' doesn't have a default value src/XF/Db/AbstractStatement.php:228

and:

Code:
INSERT  INTO `xf_user` (`visible`, `activity_visible`, `user_group_id`, `timezone`, `language_id`, `last_summary_email_date`, `username`, `email`, `secondary_group_ids`, `user_state`, `security_lock`, `is_staff`, `custom_title`, `message_count`, `reaction_score`, `trophy_points`, `style_id`, `display_style_group_id`, `secret_key`, `user_id`, `username_date`, `username_date_visible`, `permission_combination_id`, `question_solution_count`, `alerts_unviewed`, `alerts_unread`, `conversations_unread`, `register_date`, `last_activity`, `avatar_date`, `avatar_width`, `avatar_height`, `avatar_highdpi`, `gravatar`, `is_moderator`, `is_admin`, `is_banned`, `vote_score`, `warning_points`, `privacy_policy_accepted`, `terms_accepted`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1364, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1364, 'HY000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1510): XF\Db\AbstractAdapter->insert('xf_user', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1242): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Mvc/FormAction.php(187): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#8 src/XF/Admin/Controller/User.php(516): XF\Mvc\FormAction->run()
#9 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\User->actionSave(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:User', 'Save', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\User), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\User), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#14 src/XF.php(488): XF\App->run()
#15 admin.php(13): XF::runApp('XF\\Admin\\App')
#16 {main}

How can I solve this issue? Thanks.
 
Which (disabled) add-ons do you have installed?

The issue seems to be related to the associated_resource_ids column in the database.
 
Thanks for the quick response. Currently the only installed and activated add-ons are:

  • [TH] Nodes from ThemeHouse
  • [TH] UI.X from ThemeHouse
  • Change Author from XF2 Addons
  • Login as user from au lait
  • Meta tags from XF2 Addons
There is one more add-on which is installable, but not activated, that one is: Change date from XF2 Addons.

That's it with add-ons. I have no idea where this
Code:
associated_resource_ids
field is coming from, but I know that the user registration worked prior to the upgrade as I tested the registration before taking over this site. Thanks.
 
If this is coming from a previously installed add-on. Is there a way to get rid of this in the database somehow so that the field won't be used anymore? I have no idea which add-on it could be and the previous add-ons all have been removed prior to the upgrade to v2.2.2.
 
Run this query in phpMyAdmin:

SQL:
select * from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME like '%associated_resource_ids%'
order by TABLE_NAME

That should make it obvious which add-on it's related to and also identify the table, so a default value can be set.
 
However, I won't be using any of the previously installed add-ons anymore and I don't need to retain the data. Would getting rid of the column for this field in the database solve the issue? If so, how can I do that? Sorry, I'm not really familiar with dealing with database stuff.
 
The add-on author added the column directly to the xf_user table.

You should be okay to drop the column, as long as you don't plan to upgrade the associated legacy XF1 add-on to an XF2 compatible version.

Take a backup first.
 
Thanks, no - I definitely haven't planned to upgrade any XF1 add-ons as I've deleted all of them already once I've taken over the site. Would you mind letting me know how to get rid of the column? Sorry, not familiar with this. :X3:
 
If you are using phpMyAdmin, click on the table, then on the Structure tab at the top.

Then you can select the column via the checkbox at the left and drop it.

Or run this query:
SQL:
ALTER TABLE 'xf_user'
DROP 'associated_resource_ids';
 
Top Bottom