Results 1 to 1 of 1

Thread: Bug with custom date fields

  1. #1
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Bug with custom date fields

    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.
    Last edited by clint; 2008-03-25 at 02:22 PM.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. upgraded to 4.5.1e, received "Metadata for table tracker does not exist"
    By sfgeorge in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-09-03, 02:24 PM
  2. Replies: 8
    Last Post: 2007-04-16, 05:45 PM
  3. Replies: 3
    Last Post: 2007-03-13, 07:51 PM
  4. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  5. Bug in custom fields for date formatting...
    By ShortWave in forum Help
    Replies: 0
    Last Post: 2005-07-19, 05:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •