BUGFIX: CSVBulkLoader import method now no longer requires files to end in '.csv'. Some projects want to import files in CSV format, but not of csv file type.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@108887 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Julian Seidenberg 2010-08-04 02:57:38 +00:00 committed by Sam Minnee
parent 229760a1e1
commit 31a9271c85

View File

@ -535,7 +535,6 @@ class ModelAdmin_CollectionController extends Controller {
// File wasn't properly uploaded, show a reminder to the user
if(
empty($_FILES['_CsvFile']['tmp_name']) ||
array_search($_FILES['_CsvFile']['type'], array('text/csv', 'text/plain')) === false ||
file_get_contents($_FILES['_CsvFile']['tmp_name']) == ''
) {
$form->sessionMessage(_t('ModelAdmin.NOCSVFILE', 'Please browse for a CSV file to import'), 'good');
@ -567,6 +566,7 @@ class ModelAdmin_CollectionController extends Controller {
Director::redirectBack();
}
/**
* Return the columns available in the column selection field.
* Overload this to make other columns available