Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

3.0 - Exporting sales/earnings for a single download fails #7920

Closed
robincornett opened this issue May 15, 2020 · 1 comment · Fixed by #7951
Closed

3.0 - Exporting sales/earnings for a single download fails #7920

robincornett opened this issue May 15, 2020 · 1 comment · Fixed by #7951
Assignees
Milestone

Comments

@robincornett
Copy link
Contributor

Bug Report

Expected behavior

I should be able to export sales/earnings for a single download.

Actual behavior

When I try to export this data for a single download only, this error message is logged:

WordPress database error Column 'date_created' in where clause is ambiguous for query SELECT SUM(mce_edd_order_items.quantity) AS sales, SUM(mce_edd_order_items.total) AS earnings, mce_edd_orders.date_created FROM mce_edd_orders INNER JOIN mce_edd_order_items ON mce_edd_orders.id = mce_edd_order_items.order_id WHERE 1=1 AND mce_edd_orders.status IN ( 'complete', 'revoked' ) AND mce_edd_order_items.product_id = 3772 AND date_created >= '2018-12-31 20:00:00' AND date_created <= '2020-01-01 03:59:59' GROUP BY YEAR(mce_edd_orders.date_created), MONTH(mce_edd_orders.date_created), DAY(mce_edd_orders.date_created) ORDER BY YEAR(mce_edd_orders.date_created), MONTH(mce_edd_orders.date_created), DAY(mce_edd_orders.date_created) ASC LIMIT 0, 30 made by do_action('wp_ajax_edd_do_ajax_export'), WP_Hook->do_action, WP_Hook->apply_filters, edd_do_ajax_export, EDD_Batch_Export->process_step, EDD_Batch_Export->print_csv_rows, EDD_Batch_Sales_And_Earnings_Export->get_data

Steps to reproduce the behavior

  1. In EDD 3.0, visit Downloads > Reports > Export.
  2. Under "Export Sales and Earnings", select a specific download.
  3. The export will not complete and there is no visible error message, but the above will be logged in the PHP error log.

Information (if a specific version is affected):

PHP Version: any
EDD Version (or branch): 3.0
WordPress Version: 5.4.1

Any other relevant information:
Not part of the error, but once a download is selected here, it is impossible to deselect it--meaning to select no downloads--in order to get an export file for all downloads. Selecting a customer has the same issue.

@robincornett
Copy link
Contributor Author

Note: it's only when a date is selected that the export breaks; if no date is selected, the export is okay.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants