mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Fix 2.0 deprecations
This commit is contained in:
parent
38d05df2ec
commit
8836b2e389
@ -20,6 +20,11 @@ The master branch will try to be compatible with the latest SilverStripe release
|
||||
* Download and copy module in SilverStripe root directory and name it whatever you want
|
||||
* flush the manifest
|
||||
|
||||
## 2.0.0 deprecations
|
||||
Major depractions in latest 2.0.0 release:
|
||||
* The `GridFieldBulkImageUpload` has been renamed to `GridFieldBulkUpload`.
|
||||
* `onBulkImageUpload` callback has been renamed to `onBulkUpload`
|
||||
|
||||
## Bulk Upload
|
||||
Upload multiple images or files at once into DataObjects. Perfect for galleries and the like.
|
||||
|
||||
|
25
bulkUpload/code/GridFieldBulkImageUpload.php
Normal file
25
bulkUpload/code/GridFieldBulkImageUpload.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Legacy GridFieldBulkImageUpload component
|
||||
*
|
||||
* @deprecated 2.0 "GridFieldBulkImageUpload" is deprecated, use {@link GridFieldBulkUpload} class instead.
|
||||
*
|
||||
* @author colymba
|
||||
* @package GridFieldBulkEditingTools
|
||||
* @subpackage BulkUpload
|
||||
*/
|
||||
class GridFieldBulkImageUpload extends GridFieldBulkUpload
|
||||
{
|
||||
/**
|
||||
* Component constructor
|
||||
*
|
||||
* @deprecated 2.0 "GridFieldBulkImageUpload" is deprecated, use {@link GridFieldBulkUpload} class instead.
|
||||
*
|
||||
* @param string $fileRelationName
|
||||
*/
|
||||
public function __construct($fileRelationName = null)
|
||||
{
|
||||
Deprecation::notice('2.0', '"GridFieldBulkImageUpload" is deprecated, use "GridFieldBulkUpload" class instead.');
|
||||
return new GridFieldBulkUpload($fileRelationName);
|
||||
}
|
||||
}
|
@ -91,7 +91,12 @@ class GridFieldBulkUpload_Request extends RequestHandler
|
||||
$record->write();
|
||||
|
||||
// passes the current gridfield-instance to a call-back method on the new object
|
||||
$record->extend("onBulkFileUpload", $this->gridField);
|
||||
$record->extend("onBulkUpload", $this->gridField);
|
||||
if ( $record->hasMethod('onBulkImageUpload') )
|
||||
{
|
||||
Deprecation::notice('2.0', '"onBulkImageUpload" callback is deprecated, use "onBulkUpload" instead.');
|
||||
$record->extend("onBulkImageUpload", $this->gridField);
|
||||
}
|
||||
|
||||
//get uploadField and process upload
|
||||
$uploadField = $this->getUploadField();
|
||||
|
Loading…
Reference in New Issue
Block a user