Just downloaded the latest dev to work on ec_nodeaccess, and I just let whatever dependencies turn on automatically (the dependencies I had set on my module are ec_product and ec_store)
I keep seeing this error everywhere:

warning: max() [function.max]: Array must contain at least one element in /home/braksato/public_html/drupal6/sites/all/modules/ecommerce/ec_anon/ec_anon.module on line 172.

For your reference here is the code with the call to the max() function:

<?php

/**
 * Implementation of hook_customer_info_alter().
 *
 * Make sure that the anonymous customer type is always last.
 */
function ec_anon_customer_info_alter(&$types) {
  $weights = array_map('_ec_customer_get_weights', $types);
  unset($weights['anonymous']);
  
  $types['anonymous']->weight = max($weights)+1;
}

?>

Have I got the wrong dependencies, some stale data, or is this a bug?

Comments

gordon’s picture

Status: Active » Fixed

I have fixed this.

Basically it is a bug with only having 1 customer type enables (the anonymous customer), and there were no other enabled it was not able to determine the weight.

If you enable another customer module like the address module this issue with be resolved. The address module will provide a basic user customer type which will connect the customer to their user.

OT: I have been trying to contact you about the ec_nodeaccess module, as I have been contacted to get it going, and I am having problems. Can you please contact me via http://drupal.org/user/959/contact so that we can talk about this.

Thanks in advance.
Gordon.

danielb’s picture

Thanks, I'll send you a message.

Status: Fixed » Closed (fixed)

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