When I add a subscription I get the following error messages:

•Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of /home/getrefer/public_html/includes/common.inc).
•Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of /home/getrefer/public_html/includes/common.inc).
•Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of /home/getrefer/public_html/includes/common.inc).
•Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of /home/getrefer/public_html/includes/common.inc).
•Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of /home/getrefer/public_html/includes/common.inc).
•Notice: Undefined property: stdClass::$initial_charge in uc_recurring_product_feature_save() (line 200 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
•Notice: Undefined property: stdClass::$regular_interval in uc_recurring_product_feature_save() (line 201 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
•Notice: Undefined property: stdClass::$number_intervals in uc_recurring_product_feature_save() (line 202 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
•Notice: Undefined property: stdClass::$number_intervals in uc_recurring_product_feature_save() (line 202 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
•Notice: Undefined property: stdClass::$pfid in uc_recurring_product_feature_save() (line 207 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).

Error message when I save a previously created subscription product:

•Notice: Undefined offset: 0 in uc_recurring_subscription_product_form() (line 169 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
•Notice: Trying to get property of non-object in uc_recurring_subscription_product_form() (line 169 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
•Notice: Undefined property: stdClass::$default_option in _uc_recurring_subscription_add_interval_form() (line 509 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
•Notice: Undefined variable: default_option in _uc_recurring_subscription_add_interval_form() (line 516 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).

Comments

jabrister created an issue. See original summary.

TR’s picture

Project: Ubercart » UC Recurring Payments and Subscriptions
Version: 7.x-3.8 » 7.x-2.x-dev
Component: Products » Code
jabrister’s picture

Also, when I go to: Home » Administration » Store » Orders

I get the following error message:

Strict warning: Only variables should be passed by reference in uc_recurring_order_information() (line 542 of /home/getrefer/public_html/sites/all/modules/uc_recurring/uc_recurring.admin.inc).

Here is line 520 to 549:

  // Recurring fee details.
  $output = '';
  if (!empty($order)) {
    $fees = uc_recurring_get_fees($order);
    $output .= '<h2>' . t('Original order ID: @order_id', array('@order_id' => $order->order_id)) . '</h2>';
    $output .= theme('uc_recurring_admin_table', array('fees' => $fees));

    $output .= '<h2>' . t('Renewals') . '</h2>';
    module_load_include('inc', 'uc_order', 'uc_order.admin');

    // We can't use a subquery here because they don't play nice with extenders
    // and this will be a pager query. See http://drupal.org/node/753084
    // So just pass in the order ID's.
    $renewal_orders = db_query("SELECT renewal_order_id FROM {uc_recurring_orders} WHERE original_order_id = :order_id", array(':order_id' => $order->order_id))->fetchCol();
    // Because of the way this works if we don't have any orders we need to
    // make sure no orders show up in the results. We can't send an empty array.
    if (empty($renewal_orders)) {
      $renewal_orders[] = -1;
    }
    $condition = db_and();
    $condition->condition('o.order_id', $renewal_orders, 'IN');

    $output .= drupal_render(uc_recurring_order_admin($condition, TRUE));
  }
  else {
    $output = t('No recurring fees associated with this order');
  }

  return $output;
}
jabrister’s picture

I thought I solved it, it turned out I had disabled the subscription manager and it's dependencies. After enabling it again, I get the following error:

•Notice: Undefined offset: 6 in uc_recurring_subscription_overview() (line 49 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
•Notice: Trying to get property of non-object in uc_recurring_subscription_overview() (line 49 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
•Notice: Trying to get property of non-object in uc_recurring_subscription_overview() (line 49 of /home/getrefer/public_html/sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).

I WILL PAY SOMEONE TO FIX THIS

aotu’s picture

@jabrister

Also on-board to sponsor this fix. Generating dozens of errors during new user registration, had to disable $messages until I can get a fix...

wildlife’s picture

Any fix for this? I'm getting the following errors when I go to the Subscription page within the Edit Product page to set up a subscription:

Notice: Undefined offset: 0 in uc_recurring_subscription_product_form() (line 169 of ../sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).
Notice: Trying to get property of non-object in uc_recurring_subscription_product_form() (line 169 of ../sites/all/modules/uc_recurring/modules/uc_recurring_subscription/uc_recurring_subscription.admin.inc).

Then when I add the payment option and it redirects to the Subscription Manager page, I get the following errors:

Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of ../includes/common.inc).
Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of ../includes/common.inc).
Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of ../includes/common.inc).
Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of ../includes/common.inc).
Warning: in_array() expects parameter 2 to be array, null given in drupal_write_record() (line 7264 of ../includes/common.inc).
Notice: Undefined property: stdClass::$initial_charge in uc_recurring_product_feature_save() (line 200 of ../sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
Notice: Undefined property: stdClass::$regular_interval in uc_recurring_product_feature_save() (line 201 of ../sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
Notice: Undefined property: stdClass::$number_intervals in uc_recurring_product_feature_save() (line 202 of ../sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
Notice: Undefined property: stdClass::$number_intervals in uc_recurring_product_feature_save() (line 202 of ../sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).
Notice: Undefined property: stdClass::$pfid in uc_recurring_product_feature_save() (line 207 of ../sites/all/modules/uc_recurring/modules/uc_recurring_product/uc_recurring_product.module).

I do not know if these errors on the admin side are fatal in any way to the functionality on the end-user side. As far as I can tell, I don't think it is. Adding the product to the cart works fine, then getting to the checkout page works fine. I haven't tested any further than that though. Even though it seems to still be working, I'm afraid of making this product live on the site until I know end-users aren't going to experience any problems. I'd rather solve the errors on the admin side before using this. So if anyone can post a fix for this, it would be most appreciated.

danabel’s picture

This happened for me when I didn't have a default Payment option specified.

There must be at least one Payment option and a default must be specified to avoid this error. Maybe some form validation and a helpful message would be best.