It's the SilverStripe bulk loader, but ever so slightly better

1.0.0 2019-02-25 10:18 UTC

This package is auto-updated.

Last update: 2024-02-25 21:22:33 UTC


Scrutinizer Code Quality Build Status

It's the SilverStripe bulk loader, but ever so slightly better!

This module expands the default SS version and adds error logging per import row and attempts to solve issues where Excel sometimes adds blank columns to the end of a CSV (which then fails to import)


Instalation via composer:

# composer require i-lateral/silverstripe-slightly-better-bulkloader


By default this module should automatically replace BulkLoader_Result with a custom version that track errors.

However to make the most of this, you need to also implement your own version of CSVBulkLoader for example:


Adding the Custom CSV uploader via ModelAdmin

namespace App\Admin;

use SilverStripe\Admin\ModelAdmin;
use ilateral\SilverStripe\SlightlyBetterBulkLoader\CsvBulkLoader;

class MyModelAdmin extends ModelAdmin
    private static $managed_models = [

    private static $model_importers = [
        MyDataObject::class => CsvBulkLoader::class

Manualy Called

An example of adding a custom CSV import after a form has been submitted.

use SilverStripe\Forms\Form;
use ilateral\SilverStripe\SlightlyBetterBulkLoader\CsvBulkLoader;

class MyImportForm extends Form
    public function import($data, $form)
        $loader = CsvBulkLoader::create();
        $results = $loader->load($_FILES['_CsvFile']['tmp_name']);


        return $this->redirectBack();