custom_utils.php file is not able to get current user information

I created custom util file to create function and used language file to call that function.

Only problem I'm having is that it's not getting any information regarding current user. When I tried to print current user array to log file it shows like below:

07/06/16 16:28:54 [4504][-none-][FATAL]

As far as I know, it's not getting any userID as it shows [-none-] in log file.

Is this the Sugar Bug or I'm doing something wrong?

Parents Reply
  • Hi Ricky,

    I've checked this. Well actually it is passing through multiple times. First couple ones yes exactly what you say is happening $current_user is empty but in the last one you can the current_user.

    So, let's change your code in en_us.report_type.php;

    global $current_user;
    if(isset($current_user)){
      $app_list_strings['business_advisor_report_dom']= test();
      $GLOBALS['log']->fatal(print_r($current_user,1));
    }
    

    This should be okay to go.

    But as i understand you are trying to populate a dropdown. I would prefer to build this from Sidecar using REST End points.

    Hope this helps.

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

Children