diff --git a/_config.php b/_config.php index 6d7e5db..fe9a88a 100644 --- a/_config.php +++ b/_config.php @@ -8,6 +8,10 @@ if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . DMS_DIR)) { user_error('DMS directory named incorrectly. Please install the DMS module into a folder named: ' . DMS_DIR); } +// 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'); + CMSMenu::remove_menu_item('DMSDocumentAddController'); ShortcodeParser::get('default')->register( diff --git a/code/DMS.php b/code/DMS.php index 46950a0..0785ff1 100644 --- a/code/DMS.php +++ b/code/DMS.php @@ -1,5 +1,5 @@ getRelationAutosetClass()) { // Create new object explicitly. Otherwise rely on Upload::load to choose the class. - $fileObject = Object::create($relationClass); + $fileObject = SS_Object::create($relationClass); } }