We are facing a regression during an Magento update from 2.1.12 to 2.2.5 which I want to understand better.

Our code looks like this and is in a block on a tab of the backend order sales

public function getPostUrl()
    return $this->getUrl('orderattachments/upload/index');

The result of this call includes the order_id key in the URL, for example is


Now in 2.2.5 we get only


After lots of debugging I tracked this down to




In the recent version, _getRouteParams is not called anymore, which, during my debugging session, revealed that this adds they order_id parameter.

Is this intended (so essentially like https://xkcd.com/1172/) and I should now add the order_id manually or is this a regression in the core that should be patched?


I have been told, that is makes more sense to supply that parameter manually and not to expect that request params are added automatically.

It was an easy fix:

public function getPostUrl()
    return $this->getUrl('orderattachments/upload/index',
         ['order_id' => $this->getOrder()->getId()]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.