Task #3368

Move setArgumentsFromRawRequestData() from Router to RequestBuilder

Added by Bastian Waidelich over 10 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Should have
Category:
MVC
Start date:
2009-05-18
Due date:
% Done:

100%

Sprint:
PHP Version:
Has patch:
Complexity:

Description

That method currently doesn't really do anything Routing-related, so it should be moved from

F3\FLOW3\MVC\Web\Routing\Router

to
F3\FLOW3\MVC\Web\RequestBuilder


Related issues

Related to TYPO3.Flow - Feature #2853: Routing: @action, @format... should be settable via request arguments Resolved 2009-03-16

Associated revisions

Revision 7030ab49 (diff)
Added by Bastian Waidelich over 10 years ago

FLOW3:
  • Removed FLOW3\Utility\GenericCollection from repository, it's currently not needed. Resolves #3400
  • Moved method setArgumentsFromRawRequestData() from Router to RequestBuilder. Resolves #3368
  • Renamed URIHelper to URIBuilder. Removed Classes HelperInterface, AbstractHelper and InvalidViewHelper Exception. Adapted AbstractView & ViewInterface. Resolves #3303
  • Added section parameter to URIFor() method of the URIBuilder
  • Refactored Base controllers - controllerContext is no instance variable anymore and will be created when passed to view in initializeView(). Resolves #3404
  • ControllerContext is of scope prototype now. Added setter/getter for URIBuilder. Some cosmetic changes.
  • Added getRequestPath() to Request.
  • ControllerKeys (@controller, @action, @package, @subpackage and @format) can now be set by request arguments. Resolves #2853

History

#1 Updated by Bastian Waidelich over 10 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Bastian Waidelich

I started to move the method and write tests for it.
There's a side effect:
Before moving the method, GET & POST parameters overruled routing results as the method was called after Router->findMatchResults(). Now, "matchResults" would overwrite GET/POST parameters.
I could add a check in the route() method to only set arguments that haven't been set yet.
Before:

foreach ($matchResults as $argumentName => $argumentValue) {
    if ($argumentName[0] !== '@') {
        $this->request->setArgument($argumentName, $argumentValue);
    }
}

After:
foreach ($matchResults as $argumentName => $argumentValue) {
    if ($argumentName[0] !== '@' && !$this->request->hasArgument($argumentName)) {
        $this->request->setArgument($argumentName, $argumentValue);
    }
}

But I'm not sure, wheter Routing values should be overruled by GET/POST at all!?

#2 Updated by Robert Lemke over 10 years ago

No, the routing values should not be overruled by GET/POST, so changing the behavior is fine.

#3 Updated by Bastian Waidelich over 10 years ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2344.

Also available in: Atom PDF