Merge pull request #6523 from oilee80/master

GridFieldAddExistingAutocompleter: Make Search Response HTTPResponse
This commit is contained in:
Daniel Hensby 2017-01-17 11:21:18 +00:00 committed by GitHub
commit 55a2d1c014

View File

@ -3,6 +3,7 @@
namespace SilverStripe\Forms\GridField; namespace SilverStripe\Forms\GridField;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
@ -261,7 +262,9 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
); );
} }
Config::unnest(); Config::unnest();
return Convert::array2json($json); $response = new HTTPResponse(Convert::array2json($json));
$response->addHeader('Content-Type', 'text/json');
return $response;
} }
/** /**