mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed places where Object::get_static() was being used. Replace
with Config system instead.
This commit is contained in:
parent
16e950cb6a
commit
ccb941ea9d
@ -100,7 +100,7 @@ class DataExtensionTest extends SapphireTest {
|
|||||||
* Test that DataObject::$api_access can be set to true via a extension
|
* Test that DataObject::$api_access can be set to true via a extension
|
||||||
*/
|
*/
|
||||||
function testApiAccessCanBeExtended() {
|
function testApiAccessCanBeExtended() {
|
||||||
$this->assertTrue(Object::get_static('DataExtensionTest_Member', 'api_access'));
|
$this->assertTrue(Config::inst()->get('DataExtensionTest_Member', 'api_access', Config::FIRST_SET));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testPermissionExtension() {
|
function testPermissionExtension() {
|
||||||
|
@ -338,7 +338,7 @@ class SSViewer_DataPresenter extends SSViewer_Scope {
|
|||||||
$exposedVariables = call_user_func(array($implementer, $variableMethod));
|
$exposedVariables = call_user_func(array($implementer, $variableMethod));
|
||||||
|
|
||||||
foreach($exposedVariables as $varName => $details) {
|
foreach($exposedVariables as $varName => $details) {
|
||||||
if (!is_array($details)) $details = array('method' => $details, 'casting' => Object::get_static('ViewableData', 'default_cast'));
|
if (!is_array($details)) $details = array('method' => $details, 'casting' => Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET));
|
||||||
|
|
||||||
// If just a value (and not a key => value pair), use it for both key and value
|
// If just a value (and not a key => value pair), use it for both key and value
|
||||||
if (is_numeric($varName)) $varName = $details['method'];
|
if (is_numeric($varName)) $varName = $details['method'];
|
||||||
@ -405,7 +405,7 @@ class SSViewer_DataPresenter extends SSViewer_Scope {
|
|||||||
// Get the object to cast as
|
// Get the object to cast as
|
||||||
$casting = isset($source['casting']) ? $source['casting'] : null;
|
$casting = isset($source['casting']) ? $source['casting'] : null;
|
||||||
// If not provided, use default
|
// If not provided, use default
|
||||||
if (!$casting) $casting = Object::get_static('ViewableData', 'default_cast');
|
if (!$casting) $casting = Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET);
|
||||||
|
|
||||||
$obj = new $casting($property);
|
$obj = new $casting($property);
|
||||||
$obj->setValue($res['value']);
|
$obj->setValue($res['value']);
|
||||||
|
@ -275,7 +275,7 @@ class ViewableData extends Object implements IteratorAggregate {
|
|||||||
$class = self::$default_cast;
|
$class = self::$default_cast;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object::get_static($class, 'escape_type');
|
return Config::inst()->get($class, 'escape_type', Config::FIRST_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -389,7 +389,7 @@ class ViewableData extends Object implements IteratorAggregate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!is_object($value) && $forceReturnedObject) {
|
if(!is_object($value) && $forceReturnedObject) {
|
||||||
$default = Object::get_static('ViewableData', 'default_cast');
|
$default = Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET);
|
||||||
$value = new $default($fieldName);
|
$value = new $default($fieldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user