I've exported a product with a help description that contains a ' character. The feature becomes broken after this because it isn't escaped properly.

Comments

Johnny vd Laar’s picture

I've modified one function into this:

/**
 * Implements hook_features_export_render().
 */
function commerce_product_type_features_export_render($module, $data, $export = NULL) {
  $info = commerce_product_types();
  $output = array();
  $output[] = '  $items = array(';
  foreach ($data as $type) {
    if (isset($info[$type]) && $product_type = $info[$type]) {
      $output[] = "    '{$type}' => ".features_var_export($product_type).",";
    }
  }
  $output[] = '  );';
  $output[] = '  return $items;';
  $output = implode("\n", $output);
  return array('commerce_product_default_types' => $output);
}

This solved the problem.

pcambra’s picture

Status: Active » Fixed

Thanks for this hint, I've committed your modifications and they work great!

Status: Fixed » Closed (fixed)

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