silverstripe / silverstripe-gridfield-bulk-editing-tools

Silverstripe CMS GridField components for bulk upload and bulk record edit, unlink & delete :package::boom:
BSD 3-Clause "New" or "Revised" License
88 stars 81 forks source link

Added fileID and record variables to onBulkUpload hook (revision 1) #302

Closed mooror closed 2 months ago

mooror commented 2 months ago

Description

This PR adds the $fileID and $record variables to the "onBulkUpload" extension point that is in the createDataObject() method (in BulkUploadHandler.php). This allows developers to easily set additional fields on the newly created records and use data from the uploaded file to do so.

See the related issue for a usage example

Manual testing steps

Issues

Pull request checklist

mooror commented 2 months ago

Replaces #297

mooror commented 2 months ago

@GuySartorelli So I think I did the change correctly this time. I followed your instructions and started again, this time from the 4 branch. Made my changes and created a PR for the 4 branch.

A few things I don't know:

  1. I forgot to add "API" to the beginning of the commit. Do you want me to change that, and if so, is there a simple way to rename a commit in a PR?
  2. Does this change require tests? I haven't written a test before, but I would be willing to learn if needed
mooror commented 2 months ago

The quickest way I knew of to fix the commit text was to redo it, so I made another PR with the commit text changed.

Sorry about that

mooror commented 2 months ago

Replaced by #303