Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.2 compatibility #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion _config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<?php

if(!defined('QUICKADDNEW_MODULE')) define('QUICKADDNEW_MODULE', rtrim(basename(dirname(__FILE__))));
if(!defined('QUICKADDNEW_MODULE')) define('QUICKADDNEW_MODULE', rtrim(basename(dirname(__FILE__))));

// 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');
}
2 changes: 1 addition & 1 deletion code/extensions/QuickAddNewExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function AddNewFormHTML()
**/
public function doAddNew($data, $form)
{
$obj = Object::create($this->addNewClass);
$obj = SS_Object::create($this->addNewClass);
if (!$obj->canCreate()) {
return Security::permissionFailure(Controller::curr(), "You don't have permission to create this object");
}
Expand Down