There is no method conditon for this instance of the class RulesAnd. in FacesExtendable->__call()

Events happening in the community are now at Drupal community events on www.drupal.org.
dwkitchen's picture

rules_and() doesn't work with sub conditions in hook_default_rules_configuration_alter() giving error:

FacesExtendableException: There is no method conditon for this instance of the class RulesAnd. in FacesExtendable->__call()

Works:

<?php
  $configs
['commerce_tax_type_eu_vat']->condition(rules_or()
    ->
condition('component_rules_commerce_eu_vat_country_list', array('commerce_order:select' => 'commerce-line-item:order'))
    ->
condition(rules_and()
      ->
condition('entity_has_field', array('entity:select' => 'commerce-line-item:order', 'field' => 'commerce_customer_billing'))
      ->
condition('data_is_empty', array('data:select' => 'commerce-line-item:order:commerce-customer-billing'))
    )
  );
?>

Doesn't Work:
<?php
  $configs
['commerce_tax_rate_eu_vat_gb_standard_175']
  ->
condition(rules_or()
    ->
condition('data_is', array(
     
'data:select' => 'commerce-line-item:order:created',
     
'op' => '<',
     
'value' => strtotime('2008-12-01'),
      )
    )
    ->
condition(rules_and()
      ->
conditon('data_is', array(
       
'data:select' => 'commerce-line-item:order:created',
       
'op' => '>',
       
'value' => strtotime('2010-01-01'),
        )
      )
      ->
condition('data_is', array(
       
'data:select' => 'commerce-line-item:order:created',
       
'op' => '<',
       
'value' => strtotime('2011-01-04'),
        )
      )
    )
  );
?>

I can create the rule in the UI

Comments

Dogh - missing 'i'

dwkitchen's picture

Dogh - missing 'i'

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week