I use a fresh installed Drupal 7.8 with Heartbeat and Rules module. After installing and configuring mongoDB i tried to create Rules.
After typing name, tags and action the errormessage appears:

MongoException: zero-length keys are not allowed, did you use $ with double quotes? in MongoCollection->save() (Zeile 187 von /var/www/virtual/../sites/all/modules/mongodb/mongodb_field_storage/mongodb_field_storage.module).

No Rule is created.

Adding mongo.allow_empty_keys = 1 to my php.ini removes the message, but there is still no rule created. Any new attemp to create one dissolves into a Servererror 500:

mod_fcgid: stderr: PHP Fatal error: Nesting level too deep - recursive dependency? in /var/www/virtual/../sites/all/modules/mongodb/mongodb_field_storage/mongodb_field_storage.module on line 187, referer: http://../admin/config/workflow/rules/reaction/add

Comments

guybrush’s picture

subscribe

tom-d’s picture

subscribe

ydnar79’s picture

Any progress.... I am having the same issue.

ydnar79’s picture

Priority: Normal » Critical

Has anyone had any success in figuring out this issue? It appears to be an problem with Rules since it utilizes the Entity API in Drupal 7.

I would imagine that this would be a CRITICAL issue since Rules is such a primary tool for so many sites... And if it is not compatible with the field storage option of the MongoDB module. (Which is a major reason for many to use the module to begin with.) This would render the MongoDB option completely out.

Therefore, I am upgrading this to critical. (Hopefully others agree.)

misc’s picture

Criticial indeed.

lurkingbeast’s picture

I also ran into troubles with Rules and MongoDB. I needed to get the site working quickly so I just made a dummy hack

function mongodb_field_storage_field_storage_write($entity_type, $entity, $op, $fields, $entity_write = FALSE) {
if(strpos($entity_type, "rules") === 0) {
return;
}

Please don't make a patch out of this one, this is not how it should be :) My rules are working, although they don't touch any fields which are in mongodb.

roynilanjan’s picture

What should be the best way instead of this hack?

misc’s picture

StatusFileSize
new794 bytes

Sorry lurkingbeast, but I need an patch for this ;-)

misc’s picture

Status: Active » Needs review
StatusFileSize
new795 bytes

Sorry, on '=' missing.

Status: Needs review » Needs work

The last submitted patch, make_rules_work_with_mongodb-1269954-9.patch, failed testing.

misc’s picture

Status: Needs work » Reviewed & tested by the community
misc’s picture

Status: Reviewed & tested by the community » Closed (fixed)

I know this is not the best solution, but I think we need to be able to use Rules, so this workaround is committed to 7.x-1.x. Hopefully somebody could look into this and have rules using the field storage in mongodb also.

misc’s picture

Status: Closed (fixed) » Fixed

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