mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
7f386f52c8
commit
96ec288cd7
@ -96,7 +96,7 @@ abstract class DataFormatter extends Object {
|
|||||||
}
|
}
|
||||||
arsort($sortedClasses);
|
arsort($sortedClasses);
|
||||||
foreach($sortedClasses as $className => $priority) {
|
foreach($sortedClasses as $className => $priority) {
|
||||||
$formatter = singleton($className);
|
$formatter = new $className();
|
||||||
if(in_array($extension, $formatter->supportedExtensions())) {
|
if(in_array($extension, $formatter->supportedExtensions())) {
|
||||||
return $formatter;
|
return $formatter;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ abstract class DataFormatter extends Object {
|
|||||||
}
|
}
|
||||||
arsort($sortedClasses);
|
arsort($sortedClasses);
|
||||||
foreach($sortedClasses as $className => $priority) {
|
foreach($sortedClasses as $className => $priority) {
|
||||||
$formatter = singleton($className);
|
$formatter = new $className();
|
||||||
if(in_array($mimeType, $formatter->supportedMimeTypes())) {
|
if(in_array($mimeType, $formatter->supportedMimeTypes())) {
|
||||||
return $formatter;
|
return $formatter;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user