Skip to content
This repository
Browse code

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

with Config system instead.
  • Loading branch information...
commit ccb941ea9d1c779542bc20452a2daa71cf96d26e 1 parent 16e950c
Sean Harvey authored April 18, 2012
2  tests/model/DataExtensionTest.php
@@ -100,7 +100,7 @@ function testAddExtensionLoadsStatics() {
100 100
 	 * Test that DataObject::$api_access can be set to true via a extension
101 101
 	 */
102 102
 	function testApiAccessCanBeExtended() {
103  
-		$this->assertTrue(Object::get_static('DataExtensionTest_Member', 'api_access'));
  103
+		$this->assertTrue(Config::inst()->get('DataExtensionTest_Member', 'api_access', Config::FIRST_SET));
104 104
 	}
105 105
 	
106 106
 	function testPermissionExtension() {
4  view/SSViewer.php
@@ -338,7 +338,7 @@ protected function createCallableArray(&$extraArray, $interfaceToQuery, $variabl
338 338
 			$exposedVariables = call_user_func(array($implementer, $variableMethod));
339 339
 
340 340
 			foreach($exposedVariables as $varName => $details) {
341  
-				if (!is_array($details)) $details = array('method' => $details, 'casting' => Object::get_static('ViewableData', 'default_cast'));
  341
+				if (!is_array($details)) $details = array('method' => $details, 'casting' => Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET));
342 342
 
343 343
 				// If just a value (and not a key => value pair), use it for both key and value
344 344
 				if (is_numeric($varName)) $varName = $details['method'];
@@ -405,7 +405,7 @@ function getInjectedValue($property, $params, $cast = true) {
405 405
 				// Get the object to cast as
406 406
 				$casting = isset($source['casting']) ? $source['casting'] : null;
407 407
 				// If not provided, use default
408  
-				if (!$casting) $casting = Object::get_static('ViewableData', 'default_cast');
  408
+				if (!$casting) $casting = Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET);
409 409
 
410 410
 				$obj = new $casting($property);
411 411
 				$obj->setValue($res['value']);
4  view/ViewableData.php
@@ -275,7 +275,7 @@ public function escapeTypeForField($field) {
275 275
 			$class = self::$default_cast;
276 276
 		}
277 277
 		
278  
-		return Object::get_static($class, 'escape_type');
  278
+		return Config::inst()->get($class, 'escape_type', Config::FIRST_SET);
279 279
 	}
280 280
 	
281 281
 	/**
@@ -389,7 +389,7 @@ public function obj($fieldName, $arguments = null, $forceReturnedObject = true,
389 389
 		}
390 390
 		
391 391
 		if(!is_object($value) && $forceReturnedObject) {
392  
-			$default = Object::get_static('ViewableData', 'default_cast');
  392
+			$default = Config::inst()->get('ViewableData', 'default_cast', Config::FIRST_SET);
393 393
 			$value   = new $default($fieldName);
394 394
 		}
395 395
 		

0 notes on commit ccb941e

Please sign in to comment.
Something went wrong with that request. Please try again.