Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Fixed places where Object::get_static() was being used. Replace

with Config system instead.
  • Loading branch information...
commit ccb941ea9d1c779542bc20452a2daa71cf96d26e 1 parent 16e950c
@halkyon halkyon authored
View
2  tests/model/DataExtensionTest.php
@@ -100,7 +100,7 @@ function testAddExtensionLoadsStatics() {
* Test that DataObject::$api_access can be set to true via a extension
*/
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() {
View
4 view/SSViewer.php
@@ -338,7 +338,7 @@ protected function createCallableArray(&$extraArray, $interfaceToQuery, $variabl
$exposedVariables = call_user_func(array($implementer, $variableMethod));
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 (is_numeric($varName)) $varName = $details['method'];
@@ -405,7 +405,7 @@ function getInjectedValue($property, $params, $cast = true) {
// Get the object to cast as
$casting = isset($source['casting']) ? $source['casting'] : null;
// 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->setValue($res['value']);
View
4 view/ViewableData.php
@@ -275,7 +275,7 @@ public function escapeTypeForField($field) {
$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 @@ public function obj($fieldName, $arguments = null, $forceReturnedObject = true,
}
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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.