OAuth key management

Hi

I was creating my first Oauth keys to work with Mautic.

But before got out of the gate, received the following error:

Fatal error: Uncaught Error: Cannot use object of type OAuthToken as array in /home/beffecti/public_html/dalecarnegie/crm/modules/OAuthTokens/OAuthToken.php:307 Stack trace: #0 /home/beffecti/public_html/dalecarnegie/crm/include/SearchForm/SearchForm2.php(689): displayDateFromTs(Object(OAuthToken), 'TOKEN_TS', '', 'SearchForm_basi...') 

#1 /home/beffecti/public_html/dalecarnegie/crm/include/SearchForm/SearchForm2.php(139): SearchForm->_build_field_defs() 
#2 /home/beffecti/public_html/dalecarnegie/crm/include/SubPanel/SubPanelDefinitions.php(196): SearchForm->setup(Array, Array, 'SubpanelSearchF...', 'basic_search') 
#3 /home/beffecti/public_html/dalecarnegie/crm/include/SubPanel/SubPanelDefinitions.php(111): aSubPanel->buildSearchQuery('OAuthTokens') 
#4 /home/beffecti/public_html/dalecarnegie/crm/include/SubPanel/SubPanelDefinitions.php(707): aSubPanel->__construct('tokens', Array, Object(OAuthKey), false, false, '', Array) 
#5 /home/beffecti/public_html/dalecarnegie/crm/include/SubPanel/SubPanelTiles.php(248): SubPanelDefin in /home/beffecti/public_html/dalecarnegie/crm/modules/OAuthTokens/OAuthToken.php on line 307

It is the latest SuiteCRM install on a subdomain, on Siteground hosting

Was there a setup process that I missed somewhere, or any help on what the above means would be appreciated.

Same problem here:

Fatal error: Uncaught Error: Cannot use object of type OAuthToken as array in /…/…/…/crm/modules/OAuthTokens/OAuthToken.php:307 Stack trace: #0 /…/…/…/crm/include/SearchForm/SearchForm2.php(690): displayDateFromTs(Object(OAuthToken), ‘TOKEN_TS’, ‘’, ‘SearchForm_basi…’) #1 /…/…/…/crm/include/SearchForm/SearchForm2.php(139): SearchForm->_build_field_defs() #2 /…/…/…/crm/include/SubPanel/SubPanelDefinitions.php(196): SearchForm->setup(Array, Array, ‘SubpanelSearchF…’, ‘basic_search’) #3 /…/…/…/crm/include/SubPanel/SubPanelDefinitions.php(111): aSubPanel->buildSearchQuery(‘OAuthTokens’) #4 /…/…/…/crm/include/SubPanel/SubPanelDefinitions.php(715): aSubPanel->__construct(‘tokens’, Array, Object(OAuthKey), false, false, ‘’, Array) #5 /…/…/…/crm/include/SubPanel/SubPanelTiles.php(248): SubPanelDefinitions->load_s in /…/…/…/crm/modules/OAuthTokens/OAuthToken.php on line 307

This error shows at the Oauth Key Page.

In SuiteCRM Version 7.12
is an error in the php code. Here is a fix for it
change file “modules/OAuthTokens/OAuthToken.php”
around line 307 find function displayDateFromTs()
and replace with this one

function displayDateFromTs($focus, $field, $value, $view='ListView')
{
  $field = strtoupper($field);
  if (!is_array($focus)) {
    $testFocus = (array) $focus;
  } else  {
    $testFocus = $focus;
  }
  if (!isset($testFocus[$field])) {
    return '';
  }
  global $timedate;
  return $timedate->asUser($timedate->fromTimestamp($testFocus[$field]));
}

Hi @EjsuCalc , welcome to the community! :tada:

If that fixes the issue, you can contribute to the product by creating a Pull request on GitHub. :+1: