Fix for Use output of userreference field in profile as the default value for a userreference field in a node create form.

  1. $user = user_load(array('uid' => $GLOBALS['user']->uid));
  2. $sup = $user->field_profile_sup;
  3. $pattern = "|user/(\d+)|";
  4. preg_match($pattern, $sup, $matches);
  5. $sup_uid = $matches[1];
  6. return array(
  7.   0 => array(
  8.     'uid' => $sup_uid,
  9.   )
  10. );

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.