browse the blogs

[ 6 Feb 2014 ]

In response to a retweet of adam_webdev by kalenjordan

Magento’s flexible layout system makes adding a javascript library like handlebars a cinch.

First, download the latest version of handlebars and drop it in your root javascript folder

js/handlebars-v1.3.0.js 

Next, add the following to your local.xml file.

<layout>
<!-- this adds the javascript to the page. This needs to be in a layout update xml -->
<default>
<reference name="head">
<action method="addJs"><script>handlebars-v1.3.0.js</script></action>
</reference>
</default>

<!-- this adds ...

[ 27 Jan 2014 ]

Anatomy of the Magento PHP 5.4 Patch:

Blog post by yours truly, going into the technical details of Magento’s recent PHP 5.4 patch.

[ 23 Jan 2014 ]

How QuarkXPress became a mere afterthought in publishing:

I’m a sucker for anything that reminds of late 80s to late 90s computer/Internet culture — add in some publishing and how can I not link it? Great insights on how a business, even with a rock solid lock on their market, can only ignore the flaws in its product for so long.

[ 20 Jan 2014 ]

Magento’s configuration includes a hard coded field for the base site URL. This often creates headaches when a user migrates a system to a new server/URL, but hasn’t updated the URL entries in the core_config_data table. These headaches are compounded by

  1. The fact that the entries in core_config_data are cached by Magento
  2. Most web browsers aggressively cache HTTP header based redirects
  3. If a user didn’t update core_config_data, there’s also a good chance they’re the sort of user who wouldn’t update their web server configuration

Whenever I’m facing a problem like this with a system, I like to hop to the following code point

#File: app/code/core/Mage/Core/Controller/Varien/Front.php
if (isset($uri['scheme']) && $uri['scheme'] != $request->getScheme()
...

[ 20 Jan 2014 ]

Magento Router Configuration:

One of those things I wasn’t concretely aware of — each named Magento configuration is associated with a specific router object. You specify the router object you want to associate your configuration with via the ... tag. This is always standard or admin for the default modules, so most developers never develop an awareness of this relationship and get seemingly strange behavior when trying to extend the system.

[ 10 Jan 2014 ]

Somewhere in the past few dev releases Magento 2 got rid of the Magento\App\Dir class/object. The Magento\Filesystem object (and its getPath method) seem to be a reasonable replacement

[ 10 Jan 2014 ]

Somewhere in the past few dev releases Magento 2 got rid of the Magento\App\Dir class/object. The Magento\Filesystem object (and its getPath method) seem to be a reasonable replacement

[ 3 Jan 2014 ]

Tracking down Foreign Key Errors:

A Stack Exchange question where I walk though how to track down foreign key constraints in Magento/MySQL. The subtext here: Turning off MySQL foreign key checks and/or randomly typing things in you read on the Internet usually leads to pain.

[ 3 Jan 2014 ]

Tracking down Foreign Key Errors:

A Stack Exchange question where I walk though how to track down foreign key constraints in Magento/MySQL. The subtext here: Turning off MySQL foreign key checks and/or randomly typing things in you read on the Internet usually leads to pain.

[ 31 Dec 2013 ]

Magento Index Status:

A Magento index can have a status of pending, working, or require_reindex.

However, the UI represents pending as Ready, working as Processing, and require_reindex as Reindex Required.

Did I say UI? I meant Web UI. The command line UI (via shell/indexer.php uses the slightly-different-but-the-same-enough to be confusing Pending, Running, and Require Reindex.

I’m generally of the option that 90% of the complaints about Magento boil down to “Why are these people cutting my steak wrong”, but eBay’s Magento division doesn’t help its case when blatant inconsistencies like this are still a day to day part of a Magento developer’s life.