Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Solution for Incorrect redirection from new product form when using mod_proxy!!! 
 
paryank
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2007-08-31
Ahmedabad, Gujarat, India
 

I have installed Magento in a server which is not exposed to public network (Internet). Instead, it is connected with a Proxy Server via LAN. The Proxy Server is exposed to internet. I use apache mod_proxy module to transfer the requests.

Now, all the URLs contain session id as query string parameters. Now I go to new product page, select Product Type and Attribute Set, click on Continue button, then page is redirected to the same page instead of Product Form!!!

I observed that the JavaScript function setSettings() takes current URL, attribute set and product type as parameter and merge them directly in URL form! (Isn’t it a wrong way?) So the final URL is generated as:

http://<domain_name>/admin/catalog_product/new/?SID=<encrypted_session_id>/set/<attribute_set_id>/type/<product_type>/

Instead of:

http://<domain_name>/admin/catalog_product/new/set/<attribute_set_id>/type/<product_type>/?SID=<encrypted_session_id>

So for this reason, redirection fails!!!

I think, instead of using current URL, URL template should be used in JavaScript function that would avoid this problem.

Currently Magento detects $_SERVER[’HTTP_HOST’] as valid session host but not $_SERVER[’HTTP_X_FORWARDED_HOST’], so all the URLs are appended with Session ID query string. I think this should also be corrected!

For now I have made my own class as below:

class My_Module_Model_Session extends Mage_Core_Model_Session
{
    
public function init()
    
{
        parent
::init($namespace$sessionName);
        if (isset(
$_SERVER['HTTP_X_FORWARDED_HOST'])) {
            $hostArr 
explode(':'$_SERVER['HTTP_X_FORWARDED_HOST']);
            
$this->addHost($hostArr[0]);
        
}
        
return $this;
    
}
}

and added configuration to rewrite core/session model class name as My_Module_Model_Session. This resolves the problem. Well, I have already reported this issue on issue tracker. I hope it will be fixed soon.

 
Magento Community Magento Community
Magento Community
Magento Community
 
paryank
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2007-08-31
Ahmedabad, Gujarat, India
 

FYI: This is a quick solution for a bug (issue #7436) which is found in the version 1.1.6 and lower. It is scheduled to be fixed in next mini release (Version 1.1.7)

Thanks to Magento team

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top