Results 1 to 5 of 5

Thread: Sugarbean.php deprecated

  1. #1
    xviperforcex is offline Member
    Join Date
    Oct 2010
    Posts
    7

    Default Sugarbean.php deprecated

    I just found while debugging another problem a log message that appears every minute in log file of sugar.
    We are using Sugar 6.0.1.

    That's the message:

    Fri Nov 5 16:54:02 2010 [27652][1][DEPRECATED] SugarBean.php: preprocess_fields_on_save() is deprecated
    Fri Nov 5 16:54:02 2010 [27652][1][DEPRECATED] Formatting correction: SchedulersJobs->date_entered had formatting automatically corrected. This will be removed in the future, please upgrade your external code
    Fri Nov 5 16:54:02 2010 [27652][1][DEPRECATED] Formatting correction: SchedulersJobs->date_modified had formatting automatically corrected. This will be removed in the future, please upgrade your external code
    Fri Nov 5 16:54:02 2010 [27652][1][DEPRECATED] Formatting correction: SchedulersJobs->execute_time had formatting automatically corrected. This will be removed in the future, please upgrade your external code
    Fri Nov 5 16:54:02 2010 [27652][1][DEPRECATED] SugarBean.php: preprocess_fields_on_save() is deprecated

    I did no changes in SugarBean.php. What is meant with external code? Shall I upgrade Sugar or some other code?

    Thx in advance!

  2. #2
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Sugarbean.php deprecated

    I've had similar date/time formatting issues. Unless you're calling these functions directly I wouldn't worry too much - if the deprecated call is coming from somewhere inside the sugar core, then its Sugar Inc's job to modify these calls to remove the deprecated call when (if) they remove the actual function.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  3. #3
    xviperforcex is offline Member
    Join Date
    Oct 2010
    Posts
    7

    Default Re: Sugarbean.php deprecated

    Quote Originally Posted by robertbmirth View Post
    I've had similar date/time formatting issues. Unless you're calling these functions directly I wouldn't worry too much - if the deprecated call is coming from somewhere inside the sugar core, then its Sugar Inc's job to modify these calls to remove the deprecated call when (if) they remove the actual function.
    You're right but this minute-by-minute log entry avoids catching other more important messages. We don't want to increase the number of log files or their size just because of this message. Any ideas to solve the problem at its root?

  4. #4
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Sugarbean.php deprecated

    Hmm... this is kind of interesting.

    So, if you want to kill it at its source, you're going to have to modify <sugar_root>/data/SugarBean.php. On line 2052 you'll find the function you're looking for:
    PHP Code:
        function preprocess_fields_on_save()
        {
            
    $GLOBALS['log']->deprecated('SugarBean.php: preprocess_fields_on_save() is deprecated');
        } 
    The interesting thing is that this function is doing nothing. Its already completely deprecated, so idk why Sugar is still calling it. Maybe someone didn't call housekeeping? Anyway, if you just comment out the log call in this function it will/should stop logging it.

    I say will/should because I haven't done it; I'm very weary of making any changes to core sugar files. SugarBean.php is the core of cores - its like the Java Object class of SugarCRM. That being said, if your other, more important log calls are of type 'error' or higher, rather than changing this you should go to Admin->System Settings, scroll down to Logger settings and switch your logging level to 'error' or higher. If they're on a lower level, then if you make this change to SugarBean.php remember that it isn't upgrade safe so you may have to make it again every time you upgrade until they stop calling the function.

    *edit*
    I totally forgot about the second deprecated call. its coming from line 2174 in the same file. Looks like this:
    PHP Code:
                if ( $reformatted ) {
                    
    $GLOBALS['log']->deprecated('Formatting correction: '.$this->module_dir.'->'.$field.' had formatting automatically corrected. This will be removed in the future, please upgrade your external code');
                } 
    Do the same thing, comment out the log call, to get rid of it if you decide not to change your logger settings.
    Last edited by robertbmirth; 2010-11-09 at 04:39 PM. Reason: I forgot something.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  5. #5
    russells is offline Junior Member
    Join Date
    Jan 2011
    Posts
    1

    Default Re: Sugarbean.php deprecated

    Just a quick note that in that same file on line 1219 is the call to that empty deprecated function which you can comment out.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Deprecated: Function eregi_replace() is deprecated
    By joenineo in forum Developer Help
    Replies: 2
    Last Post: 2010-04-27, 10:45 AM
  2. Replies: 0
    Last Post: 2010-01-04, 12:21 PM
  3. Using SugarBean everywhere.
    By hensor in forum Developer Help
    Replies: 0
    Last Post: 2009-08-28, 06:58 AM
  4. SOAP API deprecated functions
    By edanb in forum Help
    Replies: 1
    Last Post: 2009-01-11, 01:58 PM
  5. What do you Want to Know about the SugarBean?
    By kpit in forum Sugar User Groups
    Replies: 9
    Last Post: 2006-11-17, 05:16 PM

Tags for this Thread

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
  •