Problem/Motivation

@walt noticed that CSV exports are not respecting exposed filters, as described in this forum topic: https://farmos.discourse.group/t/looking-for-farmos-2-x-migration-tester...

Steps to reproduce

Go to Records > Assets > Plants and export a CSV. The CSV will contain ALL assets - not just Plants.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork farm-3224663

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue tags: +Needs tests

Adding "Needs tests" tag so we remember to add an automated test for this, to prevent future regression.

m.stenta’s picture

Moving this to "stable blocker" as it does not need to block "beta".

m.stenta’s picture

I'm investigating this and it seems that filters in general ARE working fine. The issue is the "Export CSV" link that is generated on /assets/[type] paths does not include the type[]=[type] query parameter to filter by asset type. We are automatically filtering by type on those paths via a contextual filter, which does not get passed through to the CSV displays.

We may be able to alter the "Export CSV" links to add this parameter. That might be easiest way to fix this one...

m.stenta’s picture

Title: CSV exports do not respect exposed filters » CSV exports do not filter by type

Renaming this to make it a bit more specific. Still a bit misleading perhaps... the "type" filter DOES work when you use it on the /assets or /logs paths... it is only an issue on the "by type" paths (eg: /assets/[type]).

m.stenta’s picture

Ah actually... just noticing that the type-specific columns are also missing from CSVs. Not sure if that deserves its own issue, or if this can be generalized.

m.stenta’s picture

Title: CSV exports do not filter by type » Type-specific CSV exports do not respect exposed filters

Re-generalizing the title of this. I have fixes and automated tests coming together for all of the above...

m.stenta’s picture

Status: Active » Needs review
Issue tags: -Needs tests

  • m.stenta committed 79e11ab on 2.x
    Issue #3224663: Type-specific CSV exports do not respect exposed filters
    
  • m.stenta committed 8b9b108 on 2.x
    Add Issue #3224663 link to CHANGELOG.md.
    
m.stenta’s picture

Status: Needs review » Fixed

Merged.

BOTLFarm’s picture

This appears to still be broken for quantity reports. It is only exporting the first 10 results to csv. Maybe this is a different issue.

m.stenta’s picture

@BOTLFarm - Oh yes that sounds like a different issue. Can you start a new one and provide some steps to reproduce? Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.