Subscribe To RSS Feed


Mike D's SharpBlog

Just another Sharpdot weblog

Archive for October, 2009

Magento: Can’t edit/add Categories

- Wednesday, October 28th, 2009 -

I recently ran into a problem with not being able to edit or even add a new category on a Magento site. I was upgrading a site and was working on the Development installation. I had changed the site name from something like “localsite.com” to “localsiteUpgrade.com”.

All of the sudden I could not edit categories. The problem is that when I viewed the site it showed as “localsiteupgrade.com” the “U” in Upgrade got converted to “u” lowercase. This difference in the base url set in magento and the url in the browser was causing SID to appear in the url. This was breaking ajax urls like the ones used to edit categories. to fix the issue I just had to set the base site url to “localsiteupdate.com” like it was showing in the browser address bar. Durring my research I ran accross other posts showing how to use htaccess files to make sure that visitors were redirected to the proper url.

Hope this saves someone else some time!

Tags: , ,
Posted in PHP, magento | 3 Comments »

Magento: Problems/Errors after upgrade to 1.3.x with the Flat Catalog

- Friday, October 23rd, 2009 -

I recently decided to upgrade a Magento Site from version 1.2.1 to version 1.3.2.4 and the upgrade went smoothly, so I thought. When trying to enable the new caching features(Flat products and Categories) added in ver 1.3, I was unable to build the flat catalog for the categories and products. I kept getting “Flat Catalog Category rebuild error”. This was very disappointing as this was a major reason to do the upgrade.

Well not to fear, the problem was that the hosting company I used when installing Magento did not allow the “innodb” storage engine. This meant that the tables were using the  MyISAM  storage engine instead. This was the root of the problem. Keep reading to get the solution.

Luckily the Magento Team has released a Database Repair Tool. (Download here)
If you need to use the Database Repair Tool Through trial and error I found it is MUCH better to run it before updating versions. If you do it after updating(“to just fix the flat catalog error”) I have ran into other errors I believe to have been caused by updating a site with a corrupted database.
The instructions are easy to follow and worked perfectly, but here is the gist of things. You create a fresh install of Magento(same version as your site). You put the repair tool script in the web root and fill in the connection info for the damaged database and the fresh installation database. Then the script fixes broken foreign keys, storage engine types, etc.

After running the repair tool I was able to build the Flat catalog categories and products tables.
Problem Solved.

Tags: , ,
Posted in PHP, Sql, magento | 1 Comment »