Day: November 10, 2009

Skip this one, Mom

In mid-writing session:

Brendan: It’s a pretty old joke structure, but as Tina Fey has pointed out, if you get to a certain gag density people don’t notice that kind of thing. Many of the jokes in Arrested Development are groaningly old, but nobody notices because they come so thick and fast.
Brendan: … This is the part where you make a joke about coming thick and fast.
Stephen: I WOULD TOTALLY COME THICK AND FAST WITH TINA FEY
Brendan: There you go.
Stephen: BOYOYOYNG

Searchblort

If you are a regular reader of this blog, or indeed any reader of this blog, it is extremely likely that you will have no idea what the following few sentences mean. Don’t worry about it. I’m just dumping this into Google because I’ve spent the last four hours clawing at my head trying to solve a problem that is, to the best of my searching ability, undocumented anywhere else.

If you are trying to use the Magento XML-RPC (or SOAP) API to import new product data and keep getting the following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

Then it may help you to know that the catalog_product.create function takes an integer for its product attribute set ID, and that the key for the ‘Default’ set (as of Magento 1.3.2.4) is 4.

(If that doesn’t work and you recently upgraded, the most popular suggestion is to ensure that all your MySQL tables are InnoDB, but that wasn’t my problem.)