Skip to content

SilverStripe 3.7 and PHP 7.2 compatibility #17

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

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _config.php
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<?php
// SilverStripe 3.7 and PHP 7.2 compatibility
if (!class_exists('SS_Object')) {
class_alias('Object', 'SS_Object');
}
4 changes: 2 additions & 2 deletions code/extensions/EncryptDataObjectFieldsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function allMethodNames($bool)
if (in_array($this->owner->ClassName, $classes)) {
$fields = Config::inst()->get($this->owner->ClassName, 'db', Config::UNINHERITED);
foreach ($fields as $fieldName => $fieldType) {
$reflector = Object::create_from_string($fieldType, '')->is_encrypted;
$reflector = SS_Object::create_from_string($fieldType, '')->is_encrypted;
if ($reflector === true) {
$callFunction = strtolower('get' . $fieldName);
self::$db_mapping[$callFunction] = array($fieldName, $fieldType);
Expand All @@ -96,4 +96,4 @@ public function allMethodNames($bool)
}
return $methods;
}
}
}