BUGFIX: Fixed ComplexTableField export

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63581 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-10-03 02:25:49 +00:00
parent d0ba21a12f
commit 7fbeb7d6c5
2 changed files with 8 additions and 1 deletions

View File

@ -187,12 +187,19 @@ class ComplexTableField extends TableListField {
*/
function sourceFilter() {
$sourceFilter = parent::sourceFilter();
if($this->relationAutoSetting
&& $this->getParentClass()
&& ($filterKey = $this->getParentIdName($this->getParentClass(), $this->sourceClass()))
&& ($filterValue = $this->sourceID()) ) {
$newFilter = "`$filterKey` = '" . Convert::raw2sql($filterValue) . "'";
if($sourceFilter && is_array($sourceFilter)) {
// Note that the brackets below are taken into account when building this
$sourceFilter = implode(") AND (", $sourceFilter);
}
$sourceFilter = $sourceFilter ? "($sourceFilter) AND ($newFilter)" : $newFilter;
}
return $sourceFilter;

View File

@ -926,7 +926,7 @@ JS
}
}
HTTP::sendFileToBrowser($fileData, $fileName);
return HTTPRequest::send_file($fileData, $fileName);
} else {
user_error("No records found", E_USER_ERROR);
}