You should NEVER send a response from a controller, as the front controller (your index.php) is in charge of sending reponses back. This has always been the case.
send() will echo the response out, and does not return anything. So you're action is returning Response::forge(null); Since this returns an empty response object, and no after processing happens when a response object is returned, I don't see what could cause double data, the response passed back to the front controller is empty.
The second issue is a typo that sneaked in, it should be options, not option. This has been fixed in 1.8/develop, and will be part of the next release.
You are injecting a response in a response, and then sending the outer response. What is the point of that? $this->response is already a response object?
Let's look at your statement in detail.
$this->response($data)
This will set your data on $this->response, which the the REST controllers internal Response object.
Response::forge($this->response($data));
This will wrap that response object ($this->response() returns $this->response) in a new Response object.
This will echo out the representation of that response, and then return whatever send() is returning, which is null (send() doesn't have a return value).
So, at this point, your output has been send out due to your forced send() call.
Next, the REST controllers after() method kicks in, and that receives your return value. Which is NULL. So it will assume your action has set $this->response, and will return that. Since you have filled that with your data, the front controller will send that out again.
I have tested this in 1.7 using the following action:
public function action_test() { $this->format = 'json'; $data = array('this', 'is', 'a', 'test'); return Response::forge($this->response($data))->send(); }
and I get the exact same double response back
["this","is","a","test"]["this","is","a","test"]
when I use the browser to check the returned result.
I've copied all files from /core and /packages and /vendor over my installation (git didn't detect any changes), deleted most config files in /app/config, and I still get a white page as output.
There are no logs generated.
In what files can it be changed aswell? Because the core etc is copied from a fresh checkout..