During my testing of mongodb_session it seems that module_exists() called in mongodb_session_user_update()

My fields_current.user collection was never created.

patch coming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

langworthy’s picture

I've removed the call to module_exists() and instead have added mongodb_field_storage.module as a dependency.

fgm’s picture

There does not seem to be any functional reason to make session handling depend on a specific version of field storage, if you think longer.

So if sessions in MongoDB have a specific behaviour when field storage is in MongoDB, the proper way to implement it would rather be to check the field storage type and provide default behaviour for the default (SQL) field storage and specific behaviour for the MongoDB field storage, not require MongoDB field storage just to implement MongoDB sessions.

Also, using such a requirement would not port to D6, although there is a D6 port of the session component.

langworthy’s picture

This patch checks the field storage type and if it's mongodb_field_storage it will act as it did before.

I'm not sure what to do if it's field_sql_storage as there is no session.module to look at for default behaviour. I looked at some other projects like memcache but it only provides a drop in for session.inc and doesn't include a module.

fgm’s picture

Not sure what the "proper" way to go is, in this case. Have you tested whether the module and session handler worked both with and without the MongoDB field storage ? The mongodb_session.test contains almost no actual tests beyond setup: it would be worthwile implementing some tests, especially if this component is supposed to work both with and without mongodb_field_storage.

chx’s picture

I think this code is outdated and likely mongodb_field_storage_entity_update() will handle this. Did you try nuking the field storage code actually?

langworthy’s picture

I tested with the latest version of 7.x-1.x-dev and the fields_current.user collection is now being created. But it doesn't contain any roles which is causing errors. I think this is a new issue.

mgifford’s picture

Status: Active » Needs review

go bot go.