Previously, there was an issue with this module where the CSV exports would not actually pay any mind to the filters. The Sales Report seemed to be fixed by the latest updates, but the Product Report at admin/commerce/reports/products still does not seem to take the date range filters into play when clicking on the CSV button. Can that be fixed yet?

Comments

mglaman’s picture

Marking for the beta3 sprint

strings6’s picture

Hi Matt,

When is the beta3 sprint expected to happen? Knowing will help me get some idea of when the issue might be resolved.

Thanks

mglaman’s picture

strings6, I'm running Commerce Reports in a 2 month release cycle. Each cycle being a sprint. So far no one has contributed and I haven't had spare time, which means beta3 will miss the July 1st window and be pushed until September.

strings6’s picture

Hi Matt,

If you can offer any input on how you'd fix this (based on the filters you did fix), or where to look, I could try.

I have a client that is really needing date filters to work. July 1 would have been perfect (shoot!).

Thanks.

strings6’s picture

Hello,

I was wondering if the 2015-Aug-04 7.x-4.x-dev version addressed this issue.

Thanks

mglaman’s picture

Tested locally and cannot reproduce. When exporting a product report filtered by SKU or date the CSV matched each time. Leaving open because we have no test coverage for CSV exports.

strings6’s picture

The Date filters work for us on the screen, but they don't work on the export.

At first, I thought it was working for us too, but then I remembered it's the export part that isn't holding on to the filters.

mglaman’s picture

strings6 thanks for re-confirming. I'm going to write some tests to automate this so it can be nipped once and for all!

mglaman’s picture

Version: 7.x-4.0-beta2 » 7.x-4.x-dev
Assigned: Unassigned » mglaman
Status: Active » Needs review
StatusFileSize
new10.5 KB

Here's a patch to get started on bringing in test coverage. This patch doesn't include filtering results, but we had nothing so it's a good start.

mglaman’s picture

Component: Code » Views Data Export

Made a new component just for the exports.

Status: Needs review » Needs work

The last submitted patch, 9: product_report_filters-2505295-9.patch, failed testing.

mglaman’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: product_report_filters-2505295-9.patch, failed testing.

mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new10.2 KB

Reroll

  • mglaman committed d71f135 on 7.x-4.x
    Issue #2505295 by mglaman: Product Report filters do not stick during...
strings6’s picture

Hello,

OK, so you want me to switch to 7.x-4.x-dev, and apply the patch, and see if the filters for Date stick during the CSV import, or where exactly are we at with this patch?

OR, did you already apply the patch to 7.x-4.x-dev today, so I should just switch to that version and it already includes the change?

Let me know, and I'll try it.

mglaman’s picture

strings6, there isn't a patch yet. #15 and #16 are just commits to get automated test coverage of the exports going. If we want to fix this, the right way will be to get the tests to catch the error and then fix it. That way we know it won't break again :)

mglaman’s picture

StatusFileSize
new2.21 KB

Here is patch testing filters on CSV. However I think we need to test how it reads the page it's attached to.

  • mglaman committed 0df1492 on 7.x-4.x
    Issue #2505295 tests failing due to unexpected randomness of dates.
    

  • mglaman committed a014d2e on 7.x-4.x
    Issue #2505295 Add testing for filtered CSV export.
    
mglaman’s picture

Status: Needs review » Postponed (maintainer needs more info)

string6, here's how we can test, The CSV attachment link should mirror the query parameters on your filtered view. If those don't match, then there's an issue. However, if you customized the main view you may need to update the export dispkay, too.

strings6’s picture

The link does mirror the query parameters on the filtered view, for example:

admin/commerce/reports/products/csv?sku=&date_filter[min][date]=08-01-2015&date_filter[max][date]=08-31-2015

However, the result does not yield a csv file with only the data I'd expect.
My filtered view only has 143 results, but the csv file I get has 569.

When I looked closer, I found that my CSV tab in the view doesn't have the date filter. Argh!

I'm not sure if the product report view is supposed to have a data filter for the view and the csv export out of the box, or did I add it to the report at some point?
I'm wondering if I should revert the view, or if I need to add the date filter to the csv to get it.

strings6’s picture

An update:
I am still not sure if I could have just reverted the product report view (does the CSV export view come with a date filter out of the box?), but I just manually added the exposed date filter to the CSV export tab of the view (I matched the default page date filter settings). Now the export filters by the date correctly!

So I'm all set.

  • mglaman committed 0df1492 on 8.x-1.x
    Issue #2505295 tests failing due to unexpected randomness of dates.
    
  • mglaman committed a014d2e on 8.x-1.x
    Issue #2505295 Add testing for filtered CSV export.
    
  • mglaman committed d71f135 on 8.x-1.x
    Issue #2505295 by mglaman: Product Report filters do not stick during...