browse the blogs

[ 21 Dec 2014 ]

Magento 2 Profiler:

There’s still a lot of work to be done before Magento 2 is ready for general release, and a lot of that work will involve performance tuning. The old UI for enabling/disabling the built in profiler is gone, but this Stack Exchange answer from Marko Martinović tells you how to enable it. (a MAGE_PROFILER server environment variable with values of html, csv, etc)

[ 20 Dec 2014 ]

Two Vagrant boxes for the newly released Magento 2 beta.

The first is maintained by Rolando Granadino (beeplogic to Twitter folks), and is a fully featured opinionated box, with puppet provisioning, web grind for xDebug profiling, and git submodules for project dependencies.

The second is a lightweight affair from Alan Kent, Magento 2’s current lead architect.

If you’re never used Vagrant before, it’s a program for managing and creating virtual machines from the command line. If you’ve never used virtual machines before, they’re a way to “run” another computer operating system from your main computer operating system. Two virtual computers on one physical machine. Using virtual linux machines is a popular way to manage different software stacks. …

[ 17 Jul 2014 ]

Configuration Gaslighting Checklist:

A quick Stack Overflow answer from yours truly that covers what to do when you think Magneto’s gaslighting you on configuration values you’re sure you’ve changed.

[ 16 Jul 2014 ]

I needed to grab a few category names when all I had were the category IDs

$categories = Mage::getModel('catalog/category')->getCollection()
->addFieldToFilter('category_id', array('in'=>$product['category_ids']));

Can you spot the error? PHP complained with the following error

Fatal error: Call to a member function getBackend() on a non-object in /Users/alanstorm/Sites2014/ on line 816

Can you spot the error now? Unless you happen to be working on a project where you’re deep inside Magento’s EAV implementation, the above error message is worse than useless when it comes to tracking down the actual error.

The problem was I used category_id — and a Magento category object has no such field. I should have used entity_id. Easy brain fart — made easier in that Magento doesn’t stick to the …

[ 13 Jul 2014 ]

In a stock Magento system, there’s several tables where a row will have an ID field of 0.

mysql> select * from core_store\G:
*************************** 1. row ***************************
  store_id: 0
      code: admin
website_id: 0
  group_id: 0
      name: Admin
sort_order: 0
 is_active: 1
*************************** 2. row ***************************
  store_id: 1
      code: default
website_id: 1
  group_id: 1
      name: Default Store View
sort_order: 0
 is_active: 1

In turn, there are times where the Magento application will assume these 0 ID rows exist. For example, a store ID of 0 is always interpreted as the admin store object.

In day to day operations this is no big deal — however MySQL …

[ 7 Jul 2014 ]

If you’re new to Magento, you may not realize that every remote API method has a native PHP equivalent. The why, how, and how to identify these models is covered elsewhere, but one thing I forget at my peril is how useful the API methods are when I need to serialize something as JSON or via PHP’s serialize function.


$data = serialize(Mage::getModel('catalog/product')->load($product_id));

What’s great about the API load methods is they automatically return a simple PHP array full of scaler values. Compare that to something like this


While they may seem equivalent, the catalog/product object is going to have a lot of other object references — which …

[ 5 Jul 2014 ]

Can’t Log into the Admin Roundup:

Stack Exchange answer where I (attempt to?) list every possible reason the Magento Admin might not set a session cookie, creating the dreaded “can’t log into the admin” error.

[ 5 Jul 2014 ]

Anti-SQL Bias:

Developers coming into Magento are often put off by seemingly voodoo rituals like “Don’t directly manipulate the database tables with SQL”. This may be a ritual, but it’s a smart one, and my answer to this questions tells you why. It also includes an example SQL query for fetching all the product status values when you’re ready to dive deep on Magento’s EAV structure.

[ 1 Jul 2014 ]

I can’t login to Magento Admin:

Another misconfiguration that can make it impossible for developers to log into the Magento admin.

[ 29 Jun 2014 ]


When I started using Magento the System Configuration section made me feel a little dumb — so many options, but no easy way to search for things. I’d always forget where a particular option was.

After a few months of using grep and ack to search though the system.xml files and work backwards to figure out the section, I decided to automate that process and the System Configuration Search module was the result.

Tim Reynolds had the same idea, and created a similar module named qconfig. I’ve also seen a few other implementations floating around, but I really like what Tim’s done with the search visualizations. It makes me extra embarrassed about my goofy dancing arrows. …