I just tested new 7.x-1.0-rc1 and noticed that it has made having connection_options in configuration mandatory.

README.txt gives an example and says that connection_options might be used. Out of this I got the impression that they are not mandatory. So I have used configuration like:

$conf['mongodb_connections'] = array(
    'default' => array('host' => 'localhost', 'db' => 'sitename'),
);

After installing the rc1 I got fatal error "unsupported operand types" from mongodb/mongodb.module line 30. The system is trying to have union with non-existing connection_options.

CommentFileSizeAuthor
#4 1605616.patch768 byteschx
#1 optional_options-1605616-1.patch634 bytesjiivonen

Comments

jiivonen’s picture

StatusFileSize
new634 bytes

patch

firebird’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, optional_options-1605616-1.patch, failed testing.

chx’s picture

Title: connection_options made mandatory » connection_options made mandatory for non default connection
Priority: Normal » Major
StatusFileSize
new768 bytes

There's code for default but only for default, sorry.

chx’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1605616.patch, failed testing.

chx’s picture

Component: Documentation » Miscellaneous
Status: Needs work » Fixed
jiivonen’s picture

The solution in #4 looks nice and works well. Thanks.

saltednut’s picture

I too was getting the error- and unable to get $conf['mongodb_connections'] to work from settings.php until I patched using #4 - it now is using the database I defined in settings.php - thank you, chx.

Status: Fixed » Closed (fixed)

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

marsdk’s picture

Eventhough this is closed #4 also worked for me.

fgm’s picture

Status: Closed (fixed) » Patch (to be ported)

This patch and its parent commit which introduced options to the connection constructor need backport to D6.

Anonymous’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (works as designed)

I just looked over and tested the D6 code and I also looked at the usage statistics. From what I can tell almost nobody is using or will be using this module on D6. I would mark this as works as designed and be done with it. I would also suggest reviewing all D6 tickets to see if they are relevant for D7/D8 and if not just close them as works as designed or won't fix. Do you agree?

The support for connection info was added in this commit. The backport will also need to include this fix #1891508: Specify a database to authenticate with.

slashrsm’s picture

I agree about reviewing D6 tickets and closing them where appropriate.