From 96ec288cd757beaffa2cdc802d4e1c97068ae589 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 15 Oct 2008 17:27:38 +0000 Subject: [PATCH] BUGFIX Don't use singleton() to create DataFormatter instances, as it will cause weird side-effects with multiple formatter instances with different parameters (broke subsequent test runs of RestfulServerTest and SoapModelAccessTest) - all aboard the failboat! git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64313 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- api/DataFormatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/DataFormatter.php b/api/DataFormatter.php index 25469fd9a..52da844c1 100644 --- a/api/DataFormatter.php +++ b/api/DataFormatter.php @@ -96,7 +96,7 @@ abstract class DataFormatter extends Object { } arsort($sortedClasses); foreach($sortedClasses as $className => $priority) { - $formatter = singleton($className); + $formatter = new $className(); if(in_array($extension, $formatter->supportedExtensions())) { return $formatter; } @@ -132,7 +132,7 @@ abstract class DataFormatter extends Object { } arsort($sortedClasses); foreach($sortedClasses as $className => $priority) { - $formatter = singleton($className); + $formatter = new $className(); if(in_array($mimeType, $formatter->supportedMimeTypes())) { return $formatter; }