I need to generate in one of my custom module a link to a category edit page in the backend. So I generate the url like this:
$url = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_category/index', array('id'=>$category->getId()));
or like this:
$url = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_category/edit', array('id'=>$category->getId()));
I get a correct url in both cases:
ROOT/admin/catalog_category/index/id/10/key/<security-key-here>/
//and
ROOT/admin/catalog_category/edit/id/10/key/<security-key-here>/
But when the page loads, for a split second I see in the edit form the data for my category or the category I previously edited and then there is an ajax call that clears my form and I'm on add mode. ('New Root Category'). The <title>
tag of the page contains the correct category name. On the left side tree, the correct category is selected.
The ajax call that clears the form is made to
`ROOT/admin/catalog_category/edit/key/<security-key-here>/?isAjax=true`
So there is no id parameter in the ajax call. I guess that's the problem.
How can I make this work?
This seams like a bug to me. I stand corrected. Based on David's answer this seams like a feature.
But I recall this working correctly in a really old version (don't remember which).
I tested on ce-1.7.0.2 and ce-1.8.1.0 and the result is the same.