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.

Files: 
CommentFileSizeAuthor
#3 module_exists_not_available-1412190-3.patch714 byteslangworthy
Test request sent.
[ View ]
#1 module_exists_not_available-1412190-1.patch1.75 KBlangworthy
Test request sent.
[ View ]

Comments

StatusFileSize
new1.75 KB
Test request sent.
[ View ]

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

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.

StatusFileSize
new714 bytes
Test request sent.
[ View ]

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.

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.

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?

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.

Status:Active» Needs review

go bot go.