Task #3368

Move setArgumentsFromRawRequestData() from Router to RequestBuilder

Added by Bastian Waidelich over 12 years ago. Updated almost 11 years ago.

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

100%

Estimated time:
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 argumentsResolvedBastian Waidelich2009-03-16

Actions
#1

Updated by Bastian Waidelich over 12 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 12 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 12 years ago

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

Applied in changeset r2344.

Also available in: Atom PDF