New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect CSV headers when exporting multiple record types #842
Conversation
4da5b2e
to
c925d76
Compare
c925d76
to
b2e1222
Compare
I added two more commits to this. The first checks to see if multiple bundles are being included, and if so it adds to the warning message to highlight the fact that all columns will be included and their order may vary. Screenshot: The second commit adds the ability to select which columns are included in the export. Screenshots: |
934fb5f
to
d236c11
Compare
d236c11
to
8f3f004
Compare
modules/core/export/modules/csv/src/Form/EntityCsvActionForm.php
Outdated
Show resolved
Hide resolved
8f3f004
to
8880e06
Compare
e38f7d0
to
12c3f2b
Compare
c64c54e
to
f59c7fd
Compare
Unfortunately I realized that this PR only partially fixes #805. See this comment for more detail: #805 (comment) So I pushed a commit to this PR that omits bundle-specific columns when multiple bundles are included in an export. This is a sacrifice of (currently broken) functionality, but it doesn't seem like we have a choice. I will update the description of this PR accordingly, for future reference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…l columns are included and their order may vary.
a6c4872
to
ecda35f
Compare
Fixes #805
This omits bundle-specific columns from CSV exports that includes entities of multiple bundles. It adds a warning message to the user to let them know this is happening.
It also adds the ability to select which bundles are included in the export via checkboxes.
Original description for posterity:
This is a quick and dirty fix. It builds the list of CSV column headers by iterating over every row to build a combined list. So the more rows you are exporting the less performant it may be.So it fixes a bug at the expense of a new performance consideration, which is the lesser of two evils IMO. And it buys us some time to work on a better overall fix (along with some of the other feature ideas we talked about in #805).Worth noting, one of the effects of this is that the order of columns will depend on the data, so if you export two sets of data, or if you apply different sorts to your data, you may get different column orders. But all the data will be there in the proper place.