After enabling mongodb session module, I noticed that all custom fields in profile went blank after saving the profile.

If I remove the user update hook, the custom fields work again.

Comments

misc’s picture

Do you have the same problem with the dev version of mongodb?

attekilpela’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev

Thanks for the quick response!

I noticed that I was actually using the dev version and not the beta2.

Beta2 seems to work fine.

I checked the code and found this:

Beta2:
function mongodb_session_user_update($edit, $account) {
if (!module_exists('mongodb_field_storage')) {

Dev:
function mongodb_session_user_update($edit, $account) {
// Update field values for changed values of the user.
if (module_exists('mongodb_field_storage')) {

And yes, I'm using mongodb_field_storage.

Rok Žlender’s picture

I'm looking into this as well that user update hook looks very old has @bundle and @fields in it still should have a patch ready in couple of hours.

Rok Žlender’s picture

Status: Active » Needs review
StatusFileSize
new3.87 KB

I think this patch should fix the problems and also clear out some odities in session read

  • Updates fields_current.user on user update even with mongodb_field_storage enabled, previously it was only updatin on session read
  • If record in mongo doesn't exist in reads it from mysql and puts it mongo for future reads. So in _drupal_session_read if session and user object is in mongo we don't touch sql and also do not write to mongo
Rok Žlender’s picture

StatusFileSize
new4.39 KB

A small addition to the patch to update login field in mongo that doesn't get updated through user_save.

attekilpela’s picture

Great work!

The custom fields are now saved correctly.

misc’s picture

Status: Needs review » Fixed

Wonderful, committed to the latest dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.