added support for PHP 7.2

This commit is contained in:
matej 2018-09-07 12:08:49 +02:00
parent 7c5881c7a4
commit 7bc0ff14ff
2 changed files with 8 additions and 2 deletions

View File

@ -6,3 +6,9 @@ if (!defined('BULKEDITTOOLS_PATH')) {
define('BULKEDITTOOLS_UPLOAD_PATH', $folder.'/bulkUpload'); define('BULKEDITTOOLS_UPLOAD_PATH', $folder.'/bulkUpload');
define('BULKEDITTOOLS_MANAGER_PATH', $folder.'/bulkManager'); define('BULKEDITTOOLS_MANAGER_PATH', $folder.'/bulkManager');
} }
// Ensure compatibility with PHP 7.2 ("object" is a reserved word),
// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object)
if (!class_exists('SS_Object')) {
class_alias('Object', 'SS_Object');
}

View File

@ -84,7 +84,7 @@ class GridFieldBulkUpload_Request extends RequestHandler
{ {
//create record //create record
$recordClass = $this->component->getRecordClassName($this->gridField); $recordClass = $this->component->getRecordClassName($this->gridField);
$record = Object::create($recordClass); $record = SS_Object::create($recordClass);
$record->write(); $record->write();
// passes the current gridfield-instance to a call-back method on the new object // passes the current gridfield-instance to a call-back method on the new object
@ -215,7 +215,7 @@ class GridFieldBulkUpload_Request extends RequestHandler
foreach ($attachResponses as $attachResponse) { foreach ($attachResponses as $attachResponse) {
// create record // create record
$record = Object::create($recordClass); $record = SS_Object::create($recordClass);
$record->write(); $record->write();
$record->extend('onBulkUpload', $this->gridField); $record->extend('onBulkUpload', $this->gridField);