AnsweredAssumed Answered

Bug Report: Numeric IDs break relate fields

Question asked by Richard West on Dec 22, 2016
Latest reply on Dec 29, 2016 by Patrick Sullivan

Hi all,

 

We've found a bug that is present in 7.7.1.1, and still appears to be present in 7.8.0.0.

 

The issue occurs when you have a module that have purely numeric IDs instead of using a UUID. When you place a relate to said module into another view, the link becomes unclickable.

 

The cause of this issue seems to be in SugarBean.php in the fill_in_link_field function. When the related IDs are stored as array keys, they are put in as strings. However, if it is purely numeric, array_shift extracts it as an int instead of a string. This causes the JS call to _.isEmpty to return true, which in turn does not generate the clickable link.

 

The fix to this is to change the line:

$recordId = array_shift($recordIds);

To This:

$recordId = (string)array_shift($recordIds);

 

This will fix the issue and cause the link to be correctly generated.

 

PS. How can I change the user name on this account? Alan Apter is no longer with the company and I would like to update the info but can't see where to do so

Outcomes