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

[RESOLVED] Reset Filter in Admin Will Not Work After RewriteBase is Changed in .htaccess
 
Sweet Tooth
Sr. Member
 
Avatar
Total Posts:  121
Joined:  2008-02-02
Canada
 

After installing Magento and changing the RewriteBase url to something other that ‘/magento/’, the “ResetFilter” button for all grids in the Admin panel stopped working.  Basically, the ajax calls for an empty filter and the resulting url is something like: http://localhost/some_folder/index.php/admin/catalog_category/grid/store/0/id/12/filter//?ajax=true&isAjax;=1
Notice the invalid “//” after the filter.

By having two completely separate installs of magento I’ve been able to locate the problem and fix it.  It seems that when the RewriteBase is ‘/magento/’ in the primary .htaccess file, or when the rewrite base is not set, the magento (extjs?) JavaScript grid recognizes the abundance of “/” and replaces the problem.  However, this is not the case when the primary rewrite base is set to “/some_folder/” for example.

Consider the following code, located as a prototype method for the Grid class:

addVarToUrl : function(varNamevarValue){
        
var re = new RegExp('\/('+varName+'\/.*?\/)');
        var 
parts this.url.split(new RegExp('\\?'));
        
this.url parts[0].replace(re'/');
        
this.url+= varName+'/'+varValue+'/';
        if(
parts.size()>1{
            this
.url+= '?' parts[1];
        
}
        this
.url this.url.replace(/([^:])\/{2,}/g'$1/'); // << -- make sure this line is here to solve the issue.
        
return this.url;
    
}

I hope this helps someone…

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