diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 42e4a9df9..f51c24400 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -28,6 +28,7 @@ - fix: Importing a package doesn't follow auto commit settings - add: DataForm template variable for the group to view entries - fix: EMS Badge Reporting overlaps with other EMS on the system + - fix: SQLReport templatable download doesn't run nested queries 7.4.5 - fix: Apostrophy incorrectly escaped as double quote in some places diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index f6ece2f43..534724c35 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -392,12 +392,9 @@ sub download { # Store queries in class $self->_storeQueries(); - # Call _processQuery - my $data = $self->_processQuery(0,0); - - # If we're downloading CSV if ($self->getValue("downloadType") eq "csv") { + my $data = $self->_processQuery(0,0); my $out = ""; ### Loop through the returned structure and put it through Text::CSV @@ -407,21 +404,20 @@ sub download { @{$data->{rows_loop}->[0]->{"row.field_loop"}} ); - # Data lines for my $row (@{$data->{rows_loop}}) { $out .= "\n".joinCSV(map { $_->{"field.value"} } @{$row->{"row.field_loop"}} ); - } return $out; - - } elsif ($self->getValue("downloadType") eq "template") { + } + elsif ($self->getValue("downloadType") eq "template") { + my $data = $self->_processQuery(1,0); return $self->processTemplate($data,$self->get("downloadTemplateId")); - - } else { + } + else { # I don't know what to do return; }