Closed danieliser closed 4 years ago
Seems the solution may be simple, checked those lines on local and they are calling root classes inside a namespace without the \
$date_created_gmt = new DateTime( $data->post_date );
$modified_time = new DateTime( $data->post_modified );
$modified_time_gmt = new DateTime( $data->post_modified_gmt );
Should be
$date_created_gmt = new \DateTime( $data->post_date );
$modified_time = new \DateTime( $data->post_modified );
$modified_time_gmt = new \DateTime( $data->post_modified_gmt );
Testing this on our staging to see if that upgrade completes now. If it does I can get a PR submitted for this shortly.
Seems there are also calls to new DateInterval that are missing the root slash.
Do you guys prefer \DateTime
or rather just adding use \DateTime;
near the top?
These fixes worked to resolve those issues. The process is still running on our 5 year old store, but so far so good.
I need to know your preference of prefixing each usage or calling use at the top of the file.
Throughout the codebase, we use the use \DateTime
logic only for EDD-specific classes, so I would opt for just \DateTime
.
Bug Report
Expected behavior
Upgrades run smoothly.
Actual behavior
When running "Step 1: Upgrade Orders", and it gets to the 98%+ range it gets a 500 error during the ajax process, stopping it from finishing.
Steps to reproduce the behavior
1) Run step 1 upgrade.
Information (if a specific version is affected);
PHP Version: 7.3 EDD Version (or branch): release/3.0 WordPress Version: 5.3.2
Any other relevant information:
Stack Trace:
EDD Info