Override module function in my custom module? I am using module Mixpanel in my site. And I want to override function of this module. Here is link where we can see the function or code which I need to alter CODE NEED TO MODIFIED 

Below is the code line which suggest that I can override this function :

    // Let other modules alter the defaults.
    drupal_alter('mixpanel_defaults', $properties, $account);


So from above line I am trying to override it with code as below, please let me know what I am doing wrong as it does not make any changes. However if I do same thing in main module it make changes but I don't want to make change in module but want to do in my custom module.

My custom module name: custom

function custom_mixpanel_defaults_alter($properties, $account) {

  $properties['distinct_id'] = $account-&gt;name;

}


When i see in system table weight of my custom module is 1000 and weight of Mixpanel is 0. 

Please suggest! Thanks
The error is how you define the parameters, which should be defined as custom_mixpanel_defaults_alter(&amp;$properties, $account).
PHP 5 automatically passes by reference any object passed to a function, but not the arrays. Since $properties is an array, you need to make the reference explicit.

Generally speaking, when you see a call to drupal_alter() like drupal_alter('node_view', $build), and you need to implement that alter hook, check the second and third parameter are object or arrays; in the case they are array, you need to explicitly declare the parameter as reference. In this case, hook_node_view_alter() is defined as hook_node_view_alter(&amp;$build).