Closed ultralisk- closed 9 years ago
Sorry to not have seen this earlier, I thought I got notified of such posts, but I guess I need to figure out how to ensure I do get notified.
Which export format/method is used (state export then import caused an issue)? Are the v_specials_date_avail and v_specials_expires_date columns in the file that is then imported? What is the value of the v_specials_date_avail and v_specials_expires_date upon export where this issue is seen? Is it 0001-01-01 upon export, that when then uploaded is converted to the "first date considered" by PHP of 1970-01-01 01:00:00?
The only reason this code section is run to update the date is because the v_specials_price column is present and the value is not null. Depending on that information, may need to programmatically identify the presence of the field(s) to then effect or not the current status or evaluate the value such that if it is 0001-01-01 then not to change its value, but instead use the direct assignment of 0001-01-01...
Mind trying the following?
$v_specials_date_avail = ($v_specials_date_avail == true && $v_specials_date_avail > "0001-01-01") ? date("Y-m-d H:i:s", strtotime($v_specials_date_avail)) : "0001-01-01"; $v_specials_expires_date = ($v_specials_expires_date == true && $v_specials_expires_date > "0001-01-01") ? date("Y-m-d H:i:s", strtotime($v_specials_expires_date)) : "0001-01-01";
Apologies for the late reply. I made the changes you mentioned above and did another export/import. This time the dates works as expected.
Thanks for the update!
No, thank you for identifying and confirming. Will be in the next update.
My test server is running windows, PHP 5.6.8. When I export a CSV and import it again, the special price dates all get set to the 1970, making them inactive.
easypopulate_4_import.php, line 1521~ seems to be the cause
To test, I tried this code on both my test server and my production server
Test server running Windows, PHP 5.6.8 outputs
1970-01-01 01:00:00
Production server running Linux PHP 5.4.34 outputs0001-01-01 00:00:00