Suitecrm: DetailView of OAuthKeys throughs an exception

Created on 23 Sep 2016  Â·  14Comments  Â·  Source: salesagility/SuiteCRM

Issue

After you have added an OAuthKeys, the DetailView throws an error.
( ! ) Fatal error: Cannot use object of type OAuthToken as array in SuiteCRM-7.7.4/modules/OAuthTokens/OAuthToken.php on line 305

Expected Behavior

The subpanel of related keys appears

Actual Behavior

( ! ) Fatal error: Cannot use object of type OAuthToken as array in SuiteCRM-7.7.4/modules/OAuthTokens/OAuthToken.php on line 305

Possible Fix

Update SuiteCRM-7.7.4/modules/OAuthTokens/OAuthToken.php and replace the array structure with a object structure. Instead of

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

it should be

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

Steps to Reproduce

  1. Login to SuiteCRM
  2. Goto Admin
  3. Select OAuth Keys
  4. Create a new Key
  5. View the key

Context

Trying to provide OAuth login capabilities to a 3rd party application

Your Environment

  • SuiteCRM Version used: 7.7.4
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 7):
  • Operating System and version (e.g Ubuntu 16.04):
Important Bug

All 14 comments

@bickart
I tried this on 7.7.4 running on PHP 5.5, Firefox 50, MySQL 5.5, CentOS 6, and was not able to reproduce the crash.
Could it be a new stricter rule with PHP 7?

I used 5.6.25

Thanks,

Jeff Bickart
jeff.[email protected]
Sent from my iPhone

On Sep 23, 2016, at 5:34 PM, Chris Coleman [email protected] wrote:

@bickart
I tried this on 7.7.4 running on PHP 5.5, Firefox 50, MySQL 5.5, CentOS 6, and was not able to reproduce the crash.
Could it be a new stricter rule with PHP 7?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I tested this issue on recent version of SuiteCRM(7.7.4) and not appear.
@bickart may i ask about more details about this issue, for example:
version of browser, PHP, SQL, and other information what you can provide.
Thanks for raise this issue.

Latest version of Chrome
PHP 5.6.25
MariaDB 10.1.16

I’ll share a video of the issue

Thanks,

Jeff Bickart
@bickart
jeff.[email protected]
M: 703.303.4511

On Sep 26, 2016, at 12:57 AM, Jerzy [email protected] wrote:

I tested this issue on recent version of SuiteCRM(7.7.4) and not appear.
@bickart https://github.com/bickart may i ask about more details about this issue, for example:
version of browser, PHP, SQL, and other information what you can provide.
Thanks for raise this issue.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/2308#issuecomment-249503283, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaO5c7mbvYuLYDpjSAX34GX2S_ajd1Xks5qt3rZgaJpZM4KFYun.

@bickart ,thanks it will be really helpful to see video.

Please find the a .mp4 video attached. If you are unable to see the .mp4 I can load onto youtube

Thanks,

Jeff Bickart
@bickart
jeff.[email protected]
M: 703.303.4511

On Sep 27, 2016, at 1:12 AM, Jerzy [email protected] wrote:

@bickart https://github.com/bickart ,thanks it will be really helpful to see video.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/2308#issuecomment-249796461, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaO5cXhwMZfTDeUG-dSaaiHR8xqKN7Zks5quM_SgaJpZM4KFYun.

I emailed a video (.mp4) to you. If you were unable to view it or didn’t receive it, please let me know and I’ll load it onto YouTube for you.

Thanks,

Jeff Bickart
@bickart
jeff.[email protected]
M: 703.303.4511

On Sep 27, 2016, at 1:12 AM, Jerzy [email protected] wrote:

@bickart https://github.com/bickart ,thanks it will be really helpful to see video.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/2308#issuecomment-249796461, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaO5cXhwMZfTDeUG-dSaaiHR8xqKN7Zks5quM_SgaJpZM4KFYun.

Jeff, i still do not see any video in my mailbox.

@bickart is it possible you can supply this video to @shogunpol so we can proceed with this ?
Thanks

I have posted the video at https://youtu.be/RpDZD4ICFLQ https://youtu.be/RpDZD4ICFLQ so that you can all view it.

Thanks,

Jeff Bickart
@bickart
jeff.[email protected]
M: 703.303.4511

On Oct 11, 2016, at 4:30 AM, Ian Davie [email protected] wrote:

@bickart https://github.com/bickart is it possible you can supply this video to @shogunpol https://github.com/shogunpol so we can proceed with this ?
Thanks

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/2308#issuecomment-252892302, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaO5SHRm2wlpduWg93KzQZBI_AmO-T5ks5qy3NOgaJpZM4KFYun.

The issue has been retested after provided additional info,
We labeled it as a Bug
@bickart , Thanks for additional info.

I experienced this very issue today:

Version 7.9.6
Sugar Version 6.5.25 (Build 344)
PHP Version: 7.0x

  • Created oAuth
  • View the Keys

Is the downloadable version been updated with this fix as yet?

We have the same problem with

Version 7.9.4
Sugar Version 6.5.24 (Build 509)
PHP 5.6.32

Does anyone have a solution / workaround ?

Working patch for SuiteCRM v7.10 (should work with other version just try it ;-) )

file : /html/modules/OAuthTokens
line : 302

change function displayDateFromTs code to :

function displayDateFromTs($focus, $field, $value, $view='ListView')
{    
    $field = strtoupper($field);
    if(!isset($focus->$field)) return '';
    global $timedate;
    return $timedate->asUser($timedate->fromTimestamp($focus->$field));
}
Was this page helpful?
0 / 5 - 0 ratings