Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | module_exists_not_available-1412190-3.patch | 714 bytes | langworthy |
#1 | module_exists_not_available-1412190-1.patch | 1.75 KB | langworthy |
Comments
Comment #1
langworthy CreditAttribution: langworthy commentedI've removed the call to
module_exists()
and instead have addedmongodb_field_storage.module
as a dependency.Comment #2
fgmThere 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.
Comment #3
langworthy CreditAttribution: langworthy commentedThis 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.Comment #4
fgmNot 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.
Comment #5
chx CreditAttribution: chx commentedI think this code is outdated and likely mongodb_field_storage_entity_update() will handle this. Did you try nuking the field storage code actually?
Comment #6
langworthy CreditAttribution: langworthy commentedI 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.
Comment #7
mgiffordgo bot go.