Bug #4013

Argument handling in RESTController doesn't work correctly

Added by Christoph Blömer over 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
MVC
Start date:
2009-07-28
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

The RESTController is inherited from the ActionController. Therefore the ArgumentHandling should work as intended.

The problem is due to the following code of the RESTController class.

public function processRequest(\F3\FLOW3\MVC\RequestInterface $request, \F3\FLOW3\MVC\ResponseInterface $response) {
    $this->arguments->addNewArgument('id', 'UUID', FALSE);
    parent::processRequest($request, $response);
}

Adding an argument in this code portion results in an shift of all arguments of a called method. The value for the 1st argument is now shifted to the second argument.

If addNewArgument is removed from that code it works as intended.

A possible solution would be to move that line into the initializeAction method. The argument is then added to the end of the argument array and not to the beginning.

But actually it also shouldn't be passed to the method if it is not required or specified by the method.

Also available in: Atom PDF