Hi,
I finally managed to installl this module.When I visit rules page,some rules have errors.For example for the "Subscription started (update)" rule I have this message:Error: The data type of the configured argument does not match the parameter's date requirement.
Same issue for the Subscription validity changed rule and Subscription started (insert) rule.
Also for the Apply bought subscription time I take this error :Error: The utilized component rules_commerce_sp_line_item_is_subscription_product fails the integrity check.

How can I make these rules correct?
Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

piriya33’s picture

I'm having the same error here.

piriya33’s picture

FileSize
53.42 KB

I've attached a screenshot just in case anyone who could help us with this would like a better picture.

fago’s picture

Title: Error on rules after installation » Error on rules after installation date v2.3
Status: Active » Postponed

This is caused by a recent change in date.module, see #1266688: Support microdata in date fields. The revert in date.module over there fixes the problem.

Setting to postponed until we know how date.module continues.

fago’s picture

Status: Postponed » Fixed

date fixed it, thus update to date 2.5

Status: Fixed » Closed (fixed)

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

Tribal’s picture

FileSize
59.31 KB

I am still receiving an issue, even after updating to Date v2.5. Please see attachment.

Anonymous’s picture

Status: Closed (fixed) » Active

I can confirm with @Tribal that the issue still exists.

jpstrikesback’s picture

Same here with Date 7.x-2.5+9-dev

esha’s picture

Same here, but it seems to be fixable by enabling the "Cart" and "Product pricing" modules

tom-d’s picture

Same problem with date 7.x-2.5+15-dev.

Enabling "Cart" and "Product pricing" does not fix the problem.

likewhoa’s picture

Title: Error on rules after installation date v2.3 » Error on rules after installation date v2.5
Version: 7.x-1.1 » 7.x-1.x-dev
Component: Miscellaneous » User interface

confirmed here with both stable/dev releases of date

likewhoa’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Priority: Normal » Major
FileSize
74.43 KB

adding updated screenshot to show issue at hand. This prevents subscriptions from functioning. Raising Priority level to Major.

nigelw’s picture

This bug essentially makes the 2.x version completely unusable. I would go ahead and use the 1.x and wait to update later, but on the project page it says there isn't an upgrade path between the two versions. fago, maybe if you have some time while you are in Munich you can save us? :)

BTW, loved the "There Must be Rules" session you did.

loziju’s picture

I did the following to remove all errors in rules: add a boolean field_commerce_sp_skip_expire in user. I suspect fago forgot to export this field? From the rules description, I can only guess that this is a boolean field.

Fago could you please confirm my finding above?

I haven't tested the functionality yet though. Btw, I'm using date v2.6 and so far it doesn't seem to be the root cause for errors in rules. It's good if others can confirm on this too.

likewhoa’s picture

@loziju i couldn't reproduce this on my end.

loziju’s picture

@likewhoa: I took a look at the screenshot you submit in #12. Seems like you have field_commerce_sp_validity error too. Is this field present under account?

Some experiments you can try:
- revert all features to default (it will still say overridden even after reverting, not so sure why this is so)
- update the date module (I'm using 2.6 now)
- disable the module, uninstall, make sure all fields, commerce_sp subscription product are all deleted and reinstall

Update on my part: with #14, I manage to get commerce_sp and commerce_sp_paypal to run on my site now. Rules and rules schedules are now triggered correctly. It doesn't seem to be caused by date module (I'm using 2.6). Sorry, unfortunately I don't really have time now to learn how to create patch and put it here, so #14 is the only contribution I can make as of now.

likewhoa’s picture

@loziju seems to have worked and now rules seems fine but i will need to test functionality...

likewhoa’s picture

Priority: Major » Normal
FileSize
48.83 KB

attaching screenshot and lowering priority to normal. This does not seem to be an issue with the date module but with the missing field in #14 since after adding that field and reverting the feature everything seems fine. Will test and report back.

calmher’s picture

Confirming that #14 above solved the Rules error for me (I also have Date Module v2.6). Thanks!

nigelw’s picture

@likewhoa how did the testing go? Adding the field fixes the Rules errors, but does it actually make the subscriptions work?

likewhoa’s picture

@nigelwaters I haven't had time to test functionality yet but will sometime this week.

likewhoa’s picture

FileSize
25.55 KB

doing a test transaction i encounter some rules data set errors. Attached is a screenshot from watchdog and I will paste each rules error pages below.

Unable to modify data "account:field-commerce-sp-validity": Invalid data value given. Be sure it matches the required data type and format.
Warning: Illegal string offset 'type' in rules_action_data_calc() (line 78 of /home/localhost/htdocs/sites/all/modules/rules/modules/data.eval.inc).

So in short, commerce_sp seems broken on my end and this is a fresh install with only modification noted in #14.

nigelw’s picture

Title: Error on rules after installation date v2.5 » Error on rules data sets.

In my testing it appears that manually adding the field (suggested in #14) doesn't fix the issue. Tested on a clean install. Fago, any chance you can enlighten us as to what may be happening?

likewhoa’s picture

@nigelwaters you need to revert the feature then add the field after then rules errors will disappear but functionality doesn't work anyways because of the mentioned dataset errors in #22

bmx269’s picture

What do you set for the Boolean values? 0 and 1?

nigelw’s picture

I sent a message via d.o to fago a couple of weeks ago to see if I could provide a bounty to get this fixed and did not hear anything back. If anyone has any ideas how to get the 2.x version fixed and running again, send me a message via my contact form. I'll offer up a bounty to get it done.

nigelw’s picture

I realized that I forgot to enable my personal contact form on my D.O. Account. If anyone knows how to fix the 2.x version of this module, I am willing to throw out a bounty. Please contact me via, my now enabled, contact form. :) http://drupal.org/user/1036596/contact

tribsel’s picture

i have the same problem... additionaly, after i manually added boolean field to account, i still have one rule broken:
Error: The utilized component rules_commerce_sp_line_item_subscription_product_apply fails the integrity check. in "Apply bought subscription time" reaction rule.

mh86’s picture

As mentioned in #14, the export of the skip-expire field is missing.

Andrew211’s picture

Hey, will probably laugh at this question one day, can someone explain how to:

add a boolean field_commerce_sp_skip_expire in user

as outlined in #14

Appreciated.

tribsel’s picture

@Andrew211 go to configuration -> people -> account settings -> manage fields
url is /admin/config/people/accounts/fields
and add new field called field_commerce_sp_skip_expire. you will see a dropdown with available field types, choose boolean and save.

danreb’s picture

Having hard time making this module to works too, upon searching for solutions, just found another feature module that simply works here and it can assign different role for different subscriptions products.

likewhoa’s picture

These two solutions are very inflexible, as the roles are hard-coded into the Rules actions.

^ is absolutely wrong regarding commerce_sp as it DOESN'T have any role functions built into it's feature. You have to implement this in rules yourself which is VERY flexible.

I have commerce_sp all configured with commerce_sp_paypal and it's working very well, even with recurring payments through paypal. It just works.

tribsel’s picture

@likewhoa yeah, it works... but not quite for a bit less experienced ;) i also have a lot of problems with this, eg. rules not firing or firing and show errors like Invalid data value given... same as you mentioned above. did you solve it? how?

likewhoa’s picture

@tribsel various steps including reverting feature,uninstall/reinstall,adding boolean field,setting weight on certain rules and testing the crap out of it.

tribsel’s picture

yeah, that sounds familiar. good to hear you managed to do it lol.

mh86’s picture

Status: Active » Needs review
FileSize
9.33 KB

I have a local copy of fago. Here is a patch containing the missing exports.

webdrips’s picture

#37 seems to work for me although I had not tried the 2.x branch up until now. I was able to get all my subscription products/rules working properly with this version/patch.

likewhoa’s picture

@webdrips 2.x is the only branch you should be using.

webdrips’s picture

@likewhoa, I doubt your average Drupaller would draw that conclusion (unless you mean for the patch) since the 1.x branch is the only one available on the project home page.

Andrew211’s picture

Seem to be getting pretty close, is anyone encountering an error in:

Rules -> Components

Error: Unknown action data_convert.

It's only appearing in the following component:

"Apply subscription if line item is subscription product"

Cheers

Andrew211’s picture

RE #41, if anyone needs a fix they may need to update the rules module, the rules module that comes with Commerce Kick Start didn't have that rule.

claudiu.cristea’s picture

Priority: Normal » Critical

This is critical for 7.x-2.x

claudiu.cristea’s picture

Status: Needs review » Needs work

#37 works but doesn't apply clean. I had to manually patch .info file.

Then I had to revert Subscription feature.

likewhoa’s picture

Title: Error on rules data sets. » Missing feature fields causes rules data set errors.
Status: Needs work » Needs review

@claudiu.cristea are you sure that you are applying it against a fresh git clone of 7.x-2x-dev? Keep in mind that you should uninstall your current commerce_sp, remove the sites/all/modules/commerce_sp and run the following commands.

Assuming you are in your Drupal ROOT and have drush installed.

# drush dis commerce_sp && drush pm-uninstall commerce_sp 
# rm -rf sites/all/modules/commerce_sp && drush cc all
# git clone --recursive --branch 7.x-2.x http://git.drupal.org/project/commerce_sp.git sites/all/modules/commerce_sp
# cd sites/all/modules/commerce_sp
# wget http://drupal.org/files/1522018-commerce_sp_missing_export-37.patch
# git apply <1522018-commerce_sp_missing_export-37.patch
# cd -
# drush cc all && drush en commerce_sp

likewhoa
The patch applies cleanly if done this way.

bessone’s picture

#37 worked for me

pixelsweatshop’s picture

Status: Needs review » Reviewed & tested by the community

#37 worked for me too. marking as RTBC. THanks mh86.

Liliplanet’s picture

Status: Reviewed & tested by the community » Active
FileSize
113.23 KB

Hi, it's taken me quite a while to migrate from Ubercart to Commerce and the most important part is this module as my commerce depends on the sale of roles.

Have re-installed commerce_sp 7.x-2.x and applied the patch in #37 but still have major errors ..

Error: The utilized component rules_commerce_sp_line_item_subscription_product_apply fails the integrity check.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_subscription_end fails the integrity check.

see attached screenshot.

Please would you be so kind to release the patched 7.x-2.x or attach to this thread. Would be so much appreciated :)

UPDATE: somehow got it fixed by deleting all references to commerce_sp, re-installing features and commerce_sp, so far so good :)

likewhoa’s picture

Status: Active » Reviewed & tested by the community

@Liliplanet you forgot to switch status back ;)

AaronBauman’s picture

#37 RTBC++

In addition to the steps in #45, I had to run features-revert to get everything sussed (i'm also dealing with an issue in commerce_sp_paypal).

EDIT: Additionally, I had to update to Rules-7.x-2.x-dev to get the "data_convert" action and solve the final two broken integrity checks.

RealGecko’s picture

Damn, upgrading from version 1.2 to 2.x-dev was quite a challenge. Thanks for your comments.

Rob_Feature’s picture

Followed this exactly using the method in #45 and I still am not able to revert my commerce_sp feature from overridden. it may need some additional review.

rjdjohnston’s picture

+1 - having to revert features to make #45 work

mrconnerton’s picture

I tried the patch and while it "worked" I couldn't get the feaure to revert either. I think the key here is this patch was made with features 1.x but the latest stable version of features is 2.x. Here is a new patch that will enable this module with a working defaulted feature.

I am using the following module version:
Rules 7.x-2.2
Features 7.x-2.x
Commerce Sp 7.x-2.x

mrconnerton’s picture

Status: Reviewed & tested by the community » Needs review
zkrebs’s picture

Any update on this, still can't seem to get the rules errors to go away.

mrconnerton’s picture

@slavojzizek have you tried the patch in #54 and the required modules listed there?

zkrebs’s picture

I'm using:

Date 2.6
Rules 7.x-2.2
Features 7.x-2.0-beta2
Commerce Sp (Subscription Products) 7.x-2.x-dev

Had the errors on initial install, followed #45, didn't work. Realized I needed to upgrade rules, did that. Then ran through #45 again. Then I added a field as per #14.

Tried patch #57, get

-p0 < commerce_sp-missing_exports-1522018-53_0.patch
The next patch would delete the file a/commerce_sp.features.field.inc,
which does not exist!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored
patching file b/commerce_sp.features.field_base.inc
patching file b/commerce_sp.features.field_instance.inc
patching file b/commerce_sp.features.inc
Hunk #1 FAILED at 14.
Hunk #2 FAILED at 25.
2 out of 2 hunks FAILED -- saving rejects to file b/commerce_sp.features.inc.rej
patching file b/commerce_sp.features.user_permission.inc
patching file b/commerce_sp.info
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file b/commerce_sp.info.rej
patching file b/commerce_sp.rules_defaults.inc
Hunk #1 FAILED at 194.
Hunk #2 FAILED at 278.
2 out of 2 hunks FAILED -- saving rejects to file b/commerce_sp.rules_defaults.inc.rej

Only local images are allowed.

mrconnerton’s picture

The patch I posted is not ment to work with the other patches. I suggest you try this:

  1. drush dis commerce_sp && drush pm-uninstall commerce_sp
  2. rm -rf sites/all/modules/commerce_sp && drush cc all
  3. git clone --recursive --branch 7.x-2.x http://git.drupal.org/project/commerce_sp.git sites/all/modules/commerce_sp
  4. cd sites/all/modules/commerce_sp
  5. wget https://drupal.org/files/commerce_sp-missing_exports-1522018-53_0.patch
  6. git apply commerce_sp-missing_exports-1522018-53_0.patch
  7. drush cc all && drush en commerce_sp

This disabled, uninstalls and deletes the module you have, downloads it again then apply only the patch in #53, nothing else. and enable

zkrebs’s picture

I tried #59 and still get

Could the fact that I am using Commerce Kickstart be to blame?

Error: Data selector account:field-commerce-sp-skip-expire for parameter data is invalid.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_schedule_subscription_expiration fails the integrity check.
Error: The utilized component rules_commerce_sp_subscription_end fails the integrity check.

Also, updated to Rules 7.x-2.3+1-dev

mrconnerton’s picture

I haven't actually used it with kickstart. Is the feature showing as defaulted? If its overridden, can you try and revert it?

zkrebs’s picture

EDIT: That was the key, updating the rules dev - apparently the beta2 won't work. Problem solved.

mrconnerton’s picture

nvm-read the last post

technocrat’s picture

How exactly do I get the 2.x version of commerce_sp to work? I Tried #59 with the latest dev of Rules with no luck.

UPDATE:

Okay, Finally got this to work. Follow #59 and make sure you have the latest dev of Features and Rules. Remember to Revert the Commerce SP feature. There are no more errors. Will come back and tell if payments go through correctly with Commerce_sp_paypal.

zkrebs’s picture

technocrat, please let me know. I got payments to work, however how to cancel them remains unanswered...

likewhoa’s picture

Status: Needs review » Reviewed & tested by the community

works for me.

@slavojzizek just unset the subscription validity field on the users account and then let cron handle the rest.

technocrat’s picture

@slavojzizek just unset the subscription validity field on the users account and then let cron handle the rest.

Could you please elaborate on that? I'm completely unaware of how commerce_sp_paypal handles the cancellation of the subscription. Does the module already recognize if a subscriber cancels a subscription at paypal when it updates that information during cron runs? Could the reverse action be possible too? For example, could I create a Rules Link for a subscriber to automatically cancel subscription from their own user account and it cancels the subscription both on the website and their paypal account?

a_thakur’s picture

Still have this issue.

Using
# Feature 7.x-2.x
# Rules 7.x-2.x-dev
# Commerce SP 7.x-2.x

a_thakur’s picture

The errors go away, when I revert the features, but come back when I clear the cache.

mrconnerton’s picture

@a_thakur interesting, I will try a fresh site with #59 notes an clear the cache a bunch and triple check the features.

likewhoa’s picture

WFM and below is a simple howto on getting this done. I will try to make this official documentation perhaps.

1. First you need a distro.make file with the following contents.

api = 2
core = 7.x
 
projects[drupal][type] = core
projects[drupal][download][type] = git
projects[drupal][download][branch] = 7.x
projects[drupal][download][url] = http://git.drupal.org/project/drupal.git

2. Run the following drush commands

# Fetch Drupal 7 core
> drush -y make distro.make
 
# Install Drupal 
> drush -y site-install minimal --db-url=mysql://username:password@localhost/dbname # Save the admin password for later.
 
# Install Contrib Modules
> drush -y dl addressfield-7.x-1.x-dev ctools-7.x-1.x-dev entity-7.x-1.x-dev rules-7.x-2.x-dev views-7.x-3.x-dev features-7.x-2.x-dev commerce-7.x-1.x-dev commerce_features-7.x-1.x-dev date-7.x-2.x-dev field_permissions-7.x-1.x-dev field_group-7.x-2.x-dev interval-7.x-1.x-dev admin_menu-7.x-3.x-dev devel-7.x-1.x-dev
 
# Enable Contrib Modules
> drush en -y commerce commerce_ui commerce_customer commerce_customer_ui commerce_price commerce_line_item commerce_line_item_ui commerce_order commerce_order_ui commerce_checkout commerce_payment commerce_product commerce_cart commerce_product_pricing commerce_product_ui commerce_tax_ui admin_menu devel
 
# Download, Patch and Install the Commerce Subscription Products Module
> git clone --recursive --branch 7.x-2.x http://git.drupal.org/project/commerce_sp.git sites/all/modules/commerce_sp
> cd sites/all/modules/commerce_sp
 
# Apply missing exports patch - http://drupal.org/node/1522018
> wget https://drupal.org/files/commerce_sp-missing_exports-1522018-53_0.patch 
> git apply commerce_sp-missing_exports-1522018-53_0.patch
 
# Apply anonymous subscription checkout patch
> wget http://drupal.org/files/commerce_sp-anonymous-user-subscription-fix-1554050-1.patch
> git apply commerce_sp-anonymous-user-subscription-fix-1554050-1.patch
 
# Clean up and enable Commerce Subscription Products
> rm -v *.patch
> drush -y en commerce_sp

3. UI changes

You now only need to do the following steps.
 
1. Create a few subscription based products
admin/commerce/products/add/commerce-sp-subscription
2. Create a Subscription content type with a Product reference field then reference the subscriptions added in step 1
3. Create the product display node
node/add/subscription
4. Add items from step 3 into cart and checkout.
5. Verify order was made
admin/commerce/orders
 
Ok, now that we have our first order, what should we do next? What can we do with these subscriptions? 
 
Sell user roles steps.
 
1. First lets create a customer role
> drush rcrt 'customer' 'Customer'
2. Add a rule on subscription start
admin/config/workflow/rules/reaction/manage/rules_commerce_sp_subscription_started_insert
3. Add an action
admin/config/workflow/rules/reaction/manage/rules_commerce_sp_subscription_started_insert/add/1/action
4. Select "User -> Add user role"
5. Select "customer" role created in step 1 then click Save
6. Repeat steps 3 through 5 for
admin/config/workflow/rules/reaction/manage/rules_commerce_sp_subscription_started_update
 
Remove user role at end of subscription
 
1. Add an action
admin/config/workflow/rules/reaction/manage/rules_commerce_sp_subscription_validity_is_unset
2. Select "User -> Remove user role"
3. Select "customer" role and save
 
Now proceed to make another order and then view the users profile to see the newly added "customer" role
mrconnerton’s picture

Thats some sweet documentation. We should find a place for that in docs.

As for this issue, lets keep it on track for:

  1. When I install this module, everything should stay defaulted and there should be no errors

For those that are new to features, We do indeed want your feature to be in a default state once you install it, but the moment you start changing rules and such, its going to be overriden. That is where features_override comes in.

Fago made me co-maintainer so once we can make sure this module is default out of the box, we can get it commited.

zkrebs’s picture

#71 worked, but I had to go through it and extract the goodies because I already had a DC instance going, did not want to re-do it.

muschpusch’s picture

@likewhoa: thanks a lot! Don't you want to ask fago to be a co-maintainer? The patches really need to be committed and the 2.x dev release is out of date...

mrconnerton’s picture

Status: Reviewed & tested by the community » Needs review

Fago made me a co maintainer so I can commit this patch but only a few people have said it has worked and a few others seem to still have issues. When it actually gets to RTBC then I will commit.

The goal of this patch is on a fresh install of the module, the feature exports should be in a default state.

Cellar Door’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that the steps outlined in 71 and the patch in 54 work to get the subscriptions up and running. I even used it in a commons install with success so it should be considered RTBC

PeterX-dupe’s picture

when comes the upgrade !?

cutmedia’s picture

+1 #71 works, I had persistent errors after install but reverting features fixed that.

mrconnerton’s picture

Assigned: Unassigned » mrconnerton
Status: Reviewed & tested by the community » Fixed

Commited to commit:e8bd92c7e4c141ca78678a689934cf996ccc050c.

Please remember that this requires Features 2.x

Status: Fixed » Closed (fixed)

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