Hi There

I have the rule that makes sure the currency is set correctly on shipping
Bug with shipping detailed here http://drupal.org/node/1356906

However I just found that every time cron runs the rule breaks .... then to fix it you just run update.php and it works again.

This only seem to affect the Event: 'After the user currency has set'

Any ideas?

This is my current rule.
Rule

{ "rules_shipping_currency_bug" : {
    "LABEL" : "Shipping-Currency-bug",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "commerce_shipping", "php", "rules", "commerce_multicurrency" ],
    "ON" : [ "commerce_multicurrency_user_currency_set" ],
    "IF" : [
      { "commerce_shipping_compare_shipping_service" : {
          "commerce_order" : [ "site:current-cart-order" ],
          "service" : "wear_shipping_service"
        }
      },
      { "php_eval" : { "code" : "if(arg(0) == \u0022checkout\u0022 || arg(2) == \u0022review\u0022){\r\nreturn TRUE;\r\n}" } }
    ],
    "DO" : [
      { "commerce_shipping_delete_shipping_line_items" : { "commerce_order" : [ "site:current-cart-order" ] } },
      { "redirect" : { "url" : "checkout" } }
    ]
  }
}

Comments

granticusiv’s picture

I have a rule that has been breaking daily on a live site, so I believe it is probably a cron thing too. My rule looks like this.

{ "rules_display_enquiry_form" : {
    "LABEL" : "Display enquiry form",
    "PLUGIN" : "reaction rule",
    "TAGS" : [ "enquiries" ],
    "REQUIRES" : [ "rules", "context_rules" ],
    "ON" : [ "node_view" ],
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "deal" : "deal" } } } },
      { "AND" : [  ] },
      { "data_is" : { "data" : [ "node:field-book-easy" ], "value" : "want_enquiries_only" } }
    ],
    "DO" : [
      { "rules_action_context_rules_set_context" : { "context" : "set_eqnuiries_block" } }
    ]
  }
}

Basically, if content is viewed -> if content is of type 'deal' and one of its select list fields (which is mandatory) is set to a particular option, then set a context.

When the rule breaks, I have to delete the data comparison, and then go in a recreate it. Anybody have any idea why this might be happening?

Edit: Sorry. Just realised my comment has nothing to do with the module this original post was talking about. But I'll leave my post here anyway because this is the only reference I can find on drupal.org about cron/rules conflicts.

garethhallnz’s picture

Just updating. My issue ended being an issue in the database. I was missing a table.

das-peter’s picture

Status: Active » Fixed

Glad you were able to figure out what went wrong, any idea why the table was missing?
This seems to be fixed then, right? :)

garethhallnz’s picture

Status: Fixed » Closed (fixed)

Sorry can't remember. But yes it's resolved