I found a bug a few days ago that I thought I would save some people headaches with by describing here in the forums.
Bug 20483 - Custom fields of type date don't display in reports
I was finding that some of my custom date fields were not displaying data in the list views or in reports. I narrowed it down to custom fields that didn't contain the string 'date' in the name of the field.I found that changing lines 619 and 642 in include/generic/SugarWidgets/SugarWidgetFielddatetime.php in the function displayListPlain() from checking against $layout_def['name'] to $layout_def['type'] fixed the problem.
This is where the if statements were checking if the vardef's 'name' field contains the strings "date" or "time" before displaying the data. By changing the check to be against the vardef's 'type' field as seems to be the appropriate logic, I found in my few test cases that a custom date field would display properly regardless of the name of the field.
However I didn't have time to check if this caused any unexpected behavior elsewhere in the app. So I stuck with the workaround for now of just renaming my custom date fields to include the string "date" in the name.
Hope that helps.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks