I'm getting the following error when I run any event that is set in rules to create an order.

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/pixelsti/public_html/v/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /home2/pixelsti/public_html/v/includes/entity.inc).
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT base.uid AS uid, base.name AS name, base.pass AS pass, base.mail AS mail, base.theme AS theme, base.signature AS signature, base.signature_format AS signature_format, base.created AS created, base.access AS access, base.login AS login, base.status AS status, base.timezone AS timezone, base.language AS language, base.picture AS picture, base.init AS init, base.data AS data FROM {users} base WHERE (base.uid IN ()) ; Array ( ) in DrupalDefaultEntityController->load() (line 196 of /home2/pixelsti/public_html/v/includes/entity.inc).

I tried the current recommended release (7.x-3.0) as well as 7.x-3.x-dev, where the patch in #1 (http://drupal.org/node/1388984) was committed.

Comments

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide an export of a sample rule that causes this so we can debug it more easily.

pixelsticks’s picture

Thanks! A sample rule is here:

{ "rules_create_order_on_node_update" : {
    "LABEL" : "Create Order on Node Update",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "node_update" ],
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "request_for_service" : "request_for_service" } }
        }
      },
      { "AND" : [
          { "data_is_empty" : { "data" : [ "node:field-order-id" ] } },
          { "data_is" : { "data" : [ "node:field-cost" ], "op" : "\u003E", "value" : "0" } }
        ]
      }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : { "type" : "uc_order", "param_order_status" : "pending" },
          "PROVIDE" : { "entity_created" : { "created_order" : "Created Order" } }
        }
      },
      { "data_set" : {
          "data" : [ "node-unchanged:field-order-id" ],
          "value" : [ "created-order:order-id" ]
        }
      }
    ]
  }
}

Let me know if there's anything else that can help. This is happening both on a bluehost-hosted site and my test MAMP site.

Thanks!

longwave’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new3.24 KB
new1.68 KB

Two patches: firstly a test for this scenario which should fail, and the same test plus a patch to fix this issue.

Status: Needs review » Needs work

The last submitted patch, 1487268-uc_order-entity-create.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
longwave’s picture

Status: Needs review » Fixed

Committed #3

Status: Fixed » Closed (fixed)

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