Merge pull request #181 from zemiacsik/2.1_php72support

added support for PHP 7.2
This commit is contained in:
Robbie Averill 2018-09-07 12:31:13 +02:00 committed by GitHub
commit 5d1c30d1c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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_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
$recordClass = $this->component->getRecordClassName($this->gridField);
$record = Object::create($recordClass);
$record = SS_Object::create($recordClass);
$record->write();
// 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) {
// create record
$record = Object::create($recordClass);
$record = SS_Object::create($recordClass);
$record->write();
$record->extend('onBulkUpload', $this->gridField);