I've never seen anything like that.
Do you don't have any plugins that might be connected to a user save event (i.e., any plugins that do anything related to user management)?
Are you using ClassExtender or extending the modUser object?
Repairing tables is actually pretty simple, assuming that you have cPanel and login credentials for it.
- In cPanel, launch PhpMyAdmin (in the database section)
[li>You may need your database credentials for PhpMyAdmin. Look in the core/config/config.inc.php if you forgt them.
- In PhpMyAdmin, select the MODX database on the left (you should see all the MODX database tables on the right)
- Scroll down to the bottom of the table list and select the "Check All" checkbox
- To the right of the "Check All" checkbox, use the "With Selected" drop-down and select "Repair Table
That's it.
Just out of curiosity, while you're there, select the modx_users table in the list. Compare the values in the 'id' and 'internalKey' fields. See if there is a mismatch that matches the error you're getting -- e.g., user with ID 77 has an internalKey of 43 or vice versa.
Mismatches between the 'id' and 'internalKey' fields, per se, are *not* a problem. In fact they are normal, but if some plugin that messes with users is assuming that they're always the same, it could cause your problem.
Did your own code ever save a user or user profile? If so, you might have altered the stored keys (repairing the tables won't help with this).
Here's how it's supposed to work (and you can check in the DB to see if it's set up this way):
- The basic user information is in the modx_users table.
- The user profile is in the modx_user_attributes table.
- In the modx_user_attributes table, the internalKey field for a row holds the ID of the user whose profile is stored in that row.
- IOW, the 'id' of the user in the modx_users table should match the internalKey file of the line for that user's profile in the modx_user_attributes table.
- In the modx_user_attributes table, the 'id' field is meaningless with respect to users. It often matches the 'internalKey' field, but it definitely doesn't have to.
[ed. note: BobRay last edited this post 9 years, 9 months ago.]