Unable to Import - PHP Warnings: Invalid argument supplied for foreach() and DateTime::modify(): Failed to parse time string

6.5.7 Professional

On-Site

Apache 2.2.3

PHP 5.3.19

I am attempting to mass update some Account records by importing a CSV that contains two columns of data: ID (unique Sugar ID of each account to be updated), Account Manager (Custom user field that contains the name of the account manager).  When attempting to import the accounts to update I receive the following errors:

WARNING: [2] DateTime::modify(): Failed to parse time string (+ seconds) at position 0 (+): Unexpected character on line 655 in file /var/www/html/<sugar_root>/include
WARNING: [2] Invalid argument supplied for foreach() on line 113 in file /var/www/html/<sugar_root>/include

It is urgent that I get these records updated.  A sample of my CSV is as follows.  It is imperative that I get this resolved.  To say that I am frustrated is an understatement. I have searched high and low and cannot find a resolution online.  I have found plenty of others who have had the same or similar issues, but as is common on the Sugar forums, there are no replies or the responses do not help.

IDuser_id1_c
d210e054-fcb9-9cd7-06ed-54d5447cc4f7
User Name 1
afa9040d-ebc5-d8b6-d1d4-54d55b94adfc
User Name 2
8aa64462-aa89-eff6-f02d-54e4cb32c37c
User Name 3
Parents
  • I just noticed that I'm using PHP 5.3.19 which is apparently not a supported version of PHP according to the 6.5.x Supported Platforms page.  I could've sworn I've checked my version to make sure I'm in compliances so I'm not certain why I'm on that version.  Going to go through logs and see what happened and then will try to revert or update PHP to a supported version and see if that helps considering the errors I'm getting on import are PHP related.

    As an aside, or I guess in addition, does anyone have any idea why a small version like 5.3.19 would not be supported?

  • merrik merrik Try by turning off warning in php.ini (php setting).


    - in php.ini file search  error_reporting and replace it like below
    error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING

    - OR make it off on server by checking in php setting.

  • Hi, thank you for your reply.  I meant to include in my original post that display_errors is set to Off in my php.ini file.

    ; Possible Values:
    ;   Off = Do not display any errors
    ;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
    ;   On or stdout = Display errors to STDOUTy
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; www.php.net/.../errorfunc.configuration.php
    display_errors = Off
    

    Also, error_reporting is still commented out in php.ini as it displays as follows:

    ; Default Value: E_ALL & ~E_NOTICE
    ; Development Value: E_ALL | E_STRICT
    ; Production Value: E_ALL & ~E_DEPRECATED
    ; www.php.net/.../errorfunc.configuration.php
    ;
    ; WARNING: You can not use these named values outside of PHP, like in httpd.conf or .htaccess.
    ;    See the following URLs for more information:
    ;    www.php.net/.../errorfunc.configuration.php
    ;    www.php.net/.../errorfunc.constants.php
    ;error_reporting = E_ALL & ~E_NOTICE | E_DEPRECATED
    ;error_reporting = E_ERROR | E_PARSE
    ;error_reporting = E_ALL & ~E_DEPRECATED
    

    Does it matter that the error_reporting variable is commented out still even though display_errors is set to Off?  Why would Sugar display the Warnings?

    Any other ideas ?  It is imperative that I get this resolved.

  • Yes commented means it will show all types of errors,warnings as nothing is set.
    So what you need is just remove these commented 3 lines and add the following line only
    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING

  • M Waleed Raza Thank you!  That worked and let me get everything imported.  I mean to come back sooner and mark your answer as correct and thank you but I have been very busy.  Thanks again for your help!

  • No worries man you are welcome, Glad to know it solved your problem 

Reply Children
No Data