From 7091cedc0a11eef9dfc0946b0760e967af2ded6a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 28 Feb 2011 19:23:56 -0800 Subject: [PATCH] Add the column headers back to the CSV file exported from a Thing. Fixes bug #12062. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Thingy.pm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b9a835528..6488216d0 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - fixed #12057: WebGUI::Search, assetIds search clause - fixed #12051: Prevent Proxy Caching Breaks Edit/Add Thing - fixed #12053: Thingy: View Thing Data + - fixed #12062: Thingy: column headers missing from exported file 7.10.10 - fixed #12035: Story Manager - make keywords from Story view work diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index f8111e258..ffd3e482f 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -2745,9 +2745,10 @@ sub www_export { ### Loop through the returned structure and put it through Text::CSV # Column heads + $self->session->log->warn("field labels: ". join ' ', @fieldLabels); my $csv_filename = 'export_'.$thingProperties->{label}.'.csv'; - $tempStorage->addFileFromScalar($csv_filename, WebGUI::Text::joinCSV(@fieldLabels)); open my $CSV, '>', $tempStorage->getPath($csv_filename); + print $CSV WebGUI::Text::joinCSV( @fieldLabels ); # Data lines $pb->update($i18n->get('Writing data'));