I think this is a bug in the module, to reproduce this :

1. Don't create the product class attribute
2. By not creating the product class attribute as step 1 the admin/store/subscriptions/settings payment attribute will be empty
3. save admin/store/subscriptions/settings form
4. create subscription as usual
5. now admin/store/products/classes/uc_recurring_subscription/attributes will have empty subscription row that cannot be deleted and when you view the product node view, there is an empty textfield
6. to remove the bogus attribute, I need to clean up the database and look for aid = 0 (uc_attributes, uc_attribute_option)

I believe this problem can be avoided if the module prevent the user from creating new subscription if variable_get('uc_recurring_subscription_attribute', '') is empty or not set.

Comments

univate’s picture

Priority: Critical » Normal

The variable 'uc_recurring_subscription_attribute' should not be empty to start with?

Make sure you have ubercart 2.4 patched with the api patch over at #569798: Simple Subscriptions UI or if you are using the latest ubercart 2.x-dev you just need the product api patch now. This all needs to be patched before you install this module.

duckzland’s picture

the test is done using ubercart 2.4 patched with ubercart_api.patch that comes along with the module, is that enough or I need patch it again using #569798: Simple Subscriptions UI comment #15?

univate’s picture

Thats should be fine, was it all patched before you installed? As the module should be creating this attribute as part of the installation and setting up this variable.

The module assumes that there is a specific product class and attribute setup which it can use to configure subscription.

This module itself does not add any new features it just makes it easy to setup a subscription that works well with granting/revoking roles, by combining a dozen steps into one simplified interface.

duckzland’s picture

the ubercart is patched after installed, while the uc_recurring is patched before installing it.

IMO it is better for the module to do a simple checking in the form validation looking for the form field value and if it is empty then it shouldn't go further with the subscription creation process and warn user that they are missing product class attributes.

also I got a tiny fix for the table in uc_recurring_subscription.admin.inc line 807

// modified code
  $header = array(t('Name'), t('Assigned role(s)'), t('Trial'), t('Payment Options'), '', '');

this should fix the "header missing a column" bug.

chrisshattuck’s picture

I ran into this issue too. While I wasn't able to get rid of the attribute, I was able to create a new subscription product without the automatically added attribute, so I just used that one and deleted the original.

mattcasey’s picture

I had the same issue with alpha6, solved it by recreating the product node as in #5

avpaderno’s picture

Version: 6.x-2.0-alpha5 » 6.x-2.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.