When I browse to the Create Feature page, I get 2 instances of the following commerce_coupon error:

Notice: Trying to get property of non-object in commerce_coupon_type_features_export_options() (line 36 of /Users/kendow/Sites/bluewaterlearns.local/profiles/commerce_deploy/modules/contrib/commerce_features/commerce_coupon_type.features.inc). Backtrace:
commerce_coupon_type_features_export_options('commerce_coupon_type') 
call_user_func_array('commerce_coupon_type_features_export_options', Array) features.module:582
features_invoke('commerce_coupon_type', 'features_export_options') features.admin.inc:599
_features_export_build(NULL, Array) features.admin.inc:350
_features_export_form_components(Array, Array) features.admin.inc:210
features_export_form(Array, Array) 
call_user_func_array('features_export_form', Array) form.inc:841
drupal_retrieve_form('features_export_form', Array) form.inc:350
drupal_build_form('features_export_form', Array) form.inc:130
drupal_get_form('features_export_form') 
call_user_func_array('drupal_get_form', Array) menu.inc:517
menu_execute_active_handler() index.php:21

The referenced section of commerce_coupon_type.features.inc is:

/**
 * Implements hook_features_export_options().
 */
function commerce_coupon_type_features_export_options() {
  $feature_types = array();
  $coupon_types = commerce_coupon_get_types();
  if (!empty($coupon_types)) {
    foreach($coupon_types as $type) {
      $feature_types[$type->type] = $type->label;
    }
  }
  return $feature_types;
}

There is only the default coupon type (discount_coupon) and no coupons have been created yet. I searched the Commerce Coupon issue queue and nothing turned up there. Thoughts?

CommentFileSizeAuthor
#1 commerce_coupon-2469643-1.patch1.22 KBdiscipolo

Comments

discipolo’s picture

could be you need this patch

projects[commerce_features][patch][1973602] = "https://www.drupal.org/files/issues/make_commerce_checkout-1973602-8.patch"
projects[commerce_features][patch][2173529] = "https://www.drupal.org/files/issues/commerce_features-commerce_coupon-2...."

thekenshow’s picture

Thanks! Downloaded the latest commerce_deploy, applied this patch and ran rebuild.sh without error. When I apply the new profile to my site (removing everything but ~/sites and then copying commerce_deploy into place), I get the following dependency issue message when running drush updb:

Commerce Coupon requires this module and version. Currently using Inline Entity Form version  (Currently using Unresolved dependency Inline Entity   [warning]
Form (Version >=1.5 required))
Commerce Discount requires this module and version. Currently using Inline Entity Form version  (Currently using Unresolved dependency Inline Entity [warning]
Form (Version >=1.5 required))
Commerce Discount Product Category requires this module and version. Currently using Inline Entity Form version  (Currently using Unresolved         [warning]
dependency Inline Entity Form (Version >=1.5 required))

The inline_entity_form in profiles/commerce_deploy/modules/contrib has no version number:

Fields                               Inline Entity Form (inline_entity_form)                                  Module  Enabled                           

The commerce_deploy make file does not have an entry for inline_entity_form.

I went ahead with the database update and confirmed that the commerce_coupon_type_features_export_options error message no longer appears on the Create Feature page. Will review the rest of my site functions to confirm that nothing new is broken :-)

discipolo’s picture

thekenshow’s picture

Just upgraded to the latest (May 1st) commerce_deploy and the "Trying to get property of non-object in commerce_coupon_type_features_export_options()" error message has returned. I can see that the features module version was changed to 2.5 in the latest commerce_deploy (as per the patch above) but the accompanying features patches didn't make it. Added those into commerce_deploy/drupal-org.make:

projects[commerce_features][download][type] = git
projects[commerce_features][download][branch] = 7.x-1.x
projects[commerce_features][download][revision] = ef22f28
projects[commerce_features][subdir] = commerce_contrib
projects[commerce_features][patch][1973602] =  "https://www.drupal.org/files/issues/make_commerce_checkout-1973602-8.patch"
projects[commerce_features][patch][2173529] = "https://www.drupal.org/files/issues/commerce_features-commerce_coupon-2.x-compatibility-2173529-9.patch"

Ran rebuild.sh and updated my site with the result (delete everything except ~/sites, copy in generated commerce_deploy site).

UPDATED: The coupon error DID clear, but I'm now seeing the same "Unresolved dependency Inline Entity" warning I described above:

Commerce Coupon requires this module and version. Currently using Inline Entity Form version  (Currently using Unresolved dependency Inline Entity   [warning]
...

Prior to the update, `drush pmi inline_entity_form` returned:

Version: 7.x-1.5+3-dev
Date:2015-04-30

After update, they're empty:

Version:
Date:

Looking at commerce_deploy_product.make, I see:

; We have to mark a version, otherwise dependencies will be angry (taken from tar.)
projects[inline_entity_form][version] = 1.x-dev
projects[inline_entity_form][download][type] = git
projects[inline_entity_form][download][revision] = 8229859
projects[inline_entity_form][download][branch] = 7.x-1.x
projects[inline_entity_form][subdir] = contrib
projects[inline_entity_form][patch][1777254] = http://drupal.org/files/issues/inline_entity_form-implementation-1777254-13.patch

Looking into commerce_coupon: before the update, `drush pmi commerce_coupon` returned:

Version:  7.x-2.0-beta4+13-dev
Date:  2015-04-30

After update, it they are empty:

Version:
Date:

Looking at commerce_deploy_promotions.make, I see:

projects[commerce_coupon][download][type] = git
projects[commerce_coupon][download][branch] = 7.x-2.x
projects[commerce_coupon][download][revision] = 1cf041a
projects[commerce_coupon][subdir] = contrib

Maybe your `We have to mark a version, otherwise dependencies will be angry` comment is related? Not sure where to head on this.

mglaman’s picture

Status: Active » Fixed

This fix was committed to Commerce Features, profile is now using updated module in dev.

Status: Fixed » Closed (fixed)

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