I've developed a new payment module for Magento. It works perfectly on the dev box, but when deployed to "Test" it behaves weirdly. Basically Magento tries to redirect to "<~>/index.php/admin/mypaymentmodule/processing/redirect/". What I don't really understand is why "/admin" is added. It doesn't happen in other environments where I tested the module.

Any idea?



The wrong redirect happens when the order is placed. This is how it has been implemented:

    public function getOrderPlaceRedirectUrl()
        $goToUrl = Mage::getUrl('s2s/processing/redirect');

        return $goToUrl;

It seems it get redirected twice. The first time it goes to /s2s/processing/redirect. I then receive a 302 (I don't know why) and Magento redirect to /index.php/admin/s2s/processing/redirect...

I've also tried to insert a DIE() in the redirect action of s2s controller, but it never gets there.

I suspect it is requiring admin access for some reason... but why? and why does this happen only on this Test server (not on the dev box!)?

Thanks again for your help!


I think my issue is somehow similar to this one: http://www.verious.com/qa/action-ajax-call-in-magento-response-302-need-admin-login/

But my controller extens Mage_Core_Controller_Front_Action already....


I've found out that the Redirect method is invoked. The issue happens when trying to create a Block, and I don't understand why.

This is the line: $this->getResponse()->setBody($this->getLayout()->createBlock($this->_redirectBlockType)->setOrder($order)->toHtml());

I've overridden the Block constructor in order to check if it gets called: public function _construct() { exit("REACHED!"); parent::_construct(); }

And I've found out it never gets there. The createBlock fails... why?

closed as off-topic by Fabian Blechschmidt, David Manners, Flyingmana, kab8609, Fabian Schmengler Feb 19 '15 at 16:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Fabian Blechschmidt, David Manners, Flyingmana, kab8609
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you provide some code? Specially how you do the redirect. – Marius Jun 4 '13 at 7:36
  • What configuration do you provide for your custom controller s2s? – Kristof at Fooman Jun 4 '13 at 21:00

Everthing was sorted out at the end. Briefly: our customer was trying to make changes to the code on his own...

He added something like: Mage::->Mage::->GetUrl(....). Something that would have never worked.

The error was not being logged on Magento's log files. Once we got access to PHP and other system log files, it has been easy to track down the error and correct it.

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