mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
GridFieldAddExistingAutocompleter: Make Search Response HTTPResponse
Also adds the 'text/json' Content-Type header
This commit is contained in:
parent
d192a4f86f
commit
6000e3ba16
@ -3,6 +3,7 @@
|
||||
namespace SilverStripe\Forms\GridField;
|
||||
|
||||
use SilverStripe\Control\HTTPRequest;
|
||||
use SilverStripe\Control\HTTPResponse;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Control\Controller;
|
||||
@ -261,7 +262,9 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
);
|
||||
}
|
||||
Config::unnest();
|
||||
return Convert::array2json($json);
|
||||
$response = new HTTPResponse(Convert::array2json($json));
|
||||
$response->addHeader('Content-Type', 'text/json');
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user