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

API Added fileID and record variables to onBulkUpload hook (Revision 2) #303

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

Replaces

mooror commented 2 months ago

Let me know if this PR needs tests. I have never done one before, but I am willing to learn if needed

GuySartorelli commented 2 months ago

Thanks for doing that. No tests needed - everything that already worked will still work, this just gives some additional arguments that people can opt into using when they implement the onBulkUpload extension hook method.

mooror commented 2 months ago

Thanks for doing that. No tests needed - everything that already worked will still work, this just gives some additional arguments that people can opt into using when they implement the onBulkUpload extension hook method.

Sounds good :+1: