I'm using commerce recurring module in my project (along with few additional commerce modules like card on file, invoices and few more). Recurring was working fine around 10 days ago. Since then I continued with development of other areas.

I came back to testing recurring payments and there's a problem with it during cron job rule/acion. I get following three errors in following order

Notice: Trying to get property of non-object in commerce_product_line_item_populate() (line 1354 of /site/public/sites/all/modules/contrib/commerce/modules/product_reference/commerce_product_reference.module).

Unable to get a data value. Error: Invalid data value given. Be sure it matches the required data type and format.

Unable to evaluate action commerce_recurring_generate_order_from_recurring.

I'm stunned and stuck, no idea where to start looking. Everything was fine before. I installed few other modules in the meantime, also did some custom coding, but nothing that would address or impact core recurring module setup or rules. Not even sure how to start debugging it

I've discovered there's a problem with this function on line 504 in commerce_recurring.rules.inc:

$line_item = commerce_product_line_item_new($product_wrapper->value(), $recurring_entity->quantity);

This is where errors come from. $product_wrapper->value() returns an empty Array

  • The simple answer is to methodically disable all of the new custom/contrib modules you've installed, testing the recurring functionality each time, until you find the culprit. If it was working before you made those changes, then it's pretty much 100% definite that those changes have caused the problem
    – Clive
    Mar 28, 2014 at 16:31
  • I already disabled all modules installed afterwards. Disabling modules doesn't seem to disable rules they created tho
    – belinea
    Mar 28, 2014 at 16:40
  • Either $product or $recurring_entity are probably NULL in that context, hence the error - why that might happen is anyone's guess, kind of impossible to say without knowing exactly what you changed (and exactly how it was originally set up)
    – Clive
    Mar 28, 2014 at 16:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.