When I complete the checkout for an order with line items that have Commerce Files associated, the actions for the "Issue pending licenses on checkout complete" rule are fired. But no licenses show up under "user/1/licensed-files" or "admin/commerce/file-licenses".
(I'm using the payment example module).

When I manually update an order from pending to completed, the actions for the "Issue active licenses on order update" rule fire but still no licenses show up.

I do know that the conditions are OK because I've added a drupal_set_message action to each of the reaction rules so that I can see when they are working.

I tried downloading to the latest beta and it made no difference.

Not sure if it's relevant but I'm using a site that was converted from D7 Ubercart, and one strange issue that I can see is that Commerce created orders with ids that are lower than the highest ids of orders that were migrated. The commerce ID seems to be filling the gaps left by ubercart orders that were not imported, meaning all orders that had a status other than completed. I'm not

Also, how can one properly debug rules? I have debugging turned on and the information it gives me is this:

473.391 ms Evaluating conditions of rule Issue active licenses on checkout complete. [edit]
473.919 ms The condition data_is evaluated to FALSE [edit]
473.934 ms AND evaluated to FALSE.
473.972 ms Finished reacting on event Completing the checkout process.

but it can't give me a dsm of the line-item right? It seems hard to debug.

p.s. if I manually create a file license it does work properly

Comments

jurriaanroelofs’s picture

Issue summary: View changes

debug info

jurriaanroelofs’s picture

Issue summary: View changes

spelling

tvilms’s picture

I'm seeing the same thing on 7.x-1.x-beta3. I'm not able to issue file licenses. I've tried all kinds of logical combinations of Rules, but none work. I was thinking about installing the latest 7.x-1.x-dev (from 2/24/12), but your post leads me to think it won't get any better.

tvilms’s picture

Well, I installed 7.x-1.x-dev and I'm seeing what you're seeing. The default rules are firing and no licenses are issued. The order for a Commerce File ends up in "pending" state. Then I went into Order Admin and changed state to "completed" but no licenses are issued. There are other issues related to this - some even marked closed as if to say it's working. But I'm not so sure... I guess I'll dig deeper and see if I can get this to work.

recrit’s picture

Status: Active » Needs review

test the latest dev since a lot of changes have been committed and other users have licenses working properly

joelrosen’s picture

I am having the same problem. The rule is fired but no licenses are created. I tried updating to the latest dev version and it's still the same.

Strangely I wasn't having this problem before, and I don't have this problem on my local computer, only on the remote test site. I can't tell why it's working on one site but not the other, or what I did that triggered the problem. This is very bad... any help would be much appreciated.

joelrosen’s picture

... and now the problem seems to have disappeared as mysteriously as it came, in both dev and beta versions. Wish I had a clue as to what was going on.

recrit’s picture

Status: Needs review » Active

Overview of the state of issuing license Rules

beta3 to beta3+43-dev

  • On checkout complete AND order state was "Completed", then issue licenses with a status of active
  • On checkout complete AND order state was "Pending", then issue licenses with a status of pending
  • On order update AND order state was "Completed" AND previous order state was NOT "Completed", then issue licenses as active
  • On order update AND order state was "Canceled" AND previous order state was NOT "Canceled", then set licenses to revoked status

beta3+44-dev+

All of the previous issuing rules imposed too much business logic and have been simplified to:

  • On checkout complete, then issue licenses with a status of active
  • Rules can be customized to meet a site's requirements

In progress development

  • Order admin interface for licenses associated with the order
    • Ability to update the status of all licenses associated with an order
    • Ability to update the status of licenses associated with a single line item
cindyr’s picture

Using Commerce File 7.x-1.x-beta3 with Drupal 7.9, the order was properly updated to Completed and the license was issued. After updating to Drupal 7.15, the order was not updated to Completed. After manually updating it to Completed, the license was issued.

recrit’s picture

@cindyr: this issue is regarding the latest dev version, see #6 above.

recrit’s picture

Status: Active » Needs review

The items for "In progress development" in #6 above have been completed. @see #1733364: Create an order admin interface for file licenses

@all:
Please test the new rules setup as stated in #6 and admin interface in #1733364: Create an order admin interface for file licenses

ponies’s picture

Same issue, 7.x-1.0-beta3+49-dev. Looking at the rule log, it does something for about 2.5ms, but no license is issued.

Yeah, never mind. Chalk this one up to user error.

cindyr’s picture

@recrit, sorry for the previous red herring. I thought it enlightening that a change in Drupal (not Commerce File) caused a change in the order status association on a newly placed order.

Just downloaded the latest dev 7.x-1.0-beta3+49-dev and on first trial the order was left in Pending status, and the file license was not issued.

recrit’s picture

@cindyr: make sure that you have run update.php since there has been updates. Also check that there is only 1 "Completing the checkout process" rule for Commerce File name "Issue licenses on checkout complete". You might have some left over rules from previous versions.

There is only 1 rule that fires with the latest dev and it sets to active.

cindyr’s picture

Manually changing the order status to completed causes the license to be granted.

Changing the rule "Update the order status on checkout completion" for "update the order state" to "completed" seems to work properly. Does anyone know any reason I shouldn't do that? I canceled out of the PayPal process at the last minute and it simply returned me to my order without granting a license.

cindyr’s picture

I did run update.php.

I have 5 Completing the Checkout Process rules, but only one for the Commerce File "Issue licenses on checkout complete". That rule is fine, my problem is payment didn't cause the order to switch to Completed. I think this is a PayPal module issue, not a Commerce File issue, is that right? When I set the orders to completed, the licenses are granted properly now.

recrit’s picture

Priority: Major » Normal
Status: Needs review » Postponed (maintainer needs more info)

Check your rules to ensure there are no rules for issue licenses on order update.
Currently, there is no rule defined by Commerce File that issues licenses when an order is updated to "Completed". Visit "admin/commerce/orders/{order id}/licenses" to view any line items associated with products containing Commerce File fields.

If the PayPal process interrupts checkout such that the rules even "Completing the checkout process" does not fire, then there is nothing Commerce File can do. Please review the issues at http://drupal.org/project/issues/commerce_paypal for checkout completed related issues.

bojanz’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

ps