Magento fixing error params['general[path]'] is undefined

Posted by Damodar Bashyal on June 21, 2012


After I imported categories using unirgy's uRapidFlow, I was unable to edit categories as i was getting error "params['general[path]'] is undefined" on my firebug console.

After going through magento forums I found this fix:

goto: app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml and update:

var path = params['general[path]'].split('/');  


var path = url.split('/');

But I override the form.phtml and updated like this:

create file: app\code\community\Technooze\Tadminhtml\Block\Page.php and add below code: (admin didn't pickup custom theme, so, had to rewrite the block)

class Technooze_Tadminhtml_Block_Page extends Mage_Adminhtml_Block_Page
    * Class constructor
    public function __construct()
        $action = Mage::app()->getFrontController()->getAction();
        if ($action) {

create file: app\code\community\Technooze\Tadminhtml\etc\config.xml and add below code:

<?xml version="1.0"?>

Then, create file: app\etc\modules\Technooze_All.xml and add this:

<?xml version="1.0"?>

Now, copy file: app\design\adminhtml\default\default\template\catalog\category\edit\form.phtml

to: app\design\adminhtml\default\technooze\template\catalog\category\edit\form.phtml

Search for:

var path = params['general[path]'].split('/');

just before that line add this:

var catPath = '<?php
    $categoryId = Mage::app()->getRequest()->getParam('id');
        $parentId = Mage::app()->getRequest()->getParam('parent');
        $categoryId = ($parentId ? $parentId : '0');
    $categoryId = ($categoryId ? $categoryId : Mage::app()->getWebsite(true)->getDefaultStore()->getRootCategoryId());
    $category = Mage::getModel('catalog/category')->load($categoryId);
    echo $category->getPath();
params['general[path]'] = params['general[path]'] ? params['general[path]'] : catPath;

After that update i was able to work with categories again as params['general[path]'] was never undefined again.

Not sure if there is any easier method to fix this but that helped me learn something new in magento.

not published on website

QR Code: Magento fixing error params['general[path]'] is undefined