Whenever I attempt to go into features to export anything, this error is thrown.

Here is the hunk of code in question... the error occurs in the last 4 lines before the closing }.

function uc_usps_default_rules_configuration_alter(&$configs) {
  // Domestic areas include U.S., American Samoa, Guam, Puerto Rico, and the Virgin Islands
  $countries = array(
    16 => t('American Samoa'),
    316 => t('Guam'),
    630 => t('Puerto Rico'),
    840 => t('United States'),
    850 => t('Virgin Islands (US)'),
  );

  $domestic = rules_or();
  $domestic->label = t('Order delivers to one of');
  $domestic_env = clone $domestic;

  $foreign = rules_or();
  $foreign->negate();
  $foreign->label = t('NOT Order delivers to one of');
  $foreign_env = clone $foreign;

  foreach ($countries as $country => $name) {
    $condition = rules_condition('data_is', array('data:select' => 'order:delivery-address:country', 'value' => $country));
    $condition->label = $name;

    $domestic->condition(clone $condition);
    $domestic_env->condition(clone $condition);
    $foreign->condition(clone $condition);
    $foreign_env->condition($condition);
  }


  $configs['get_quote_from_usps']->condition($domestic);
  $configs['get_quote_from_usps_env']->condition($domestic_env);
  $configs['get_quote_from_usps_intl']->condition($foreign);
  $configs['get_quote_from_usps_intl_env']->condition($foreign_env);
}
CommentFileSizeAuthor
#1 1431938-usps-rules-defaults-alter.patch595 byteslongwave

Comments

longwave’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Component: Code » Shipping
Status: Active » Needs review
StatusFileSize
new595 bytes

Please test the attached patch.

rickmanelius’s picture

Status: Needs review » Reviewed & tested by the community

Works!

tr’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

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