magento/magento2 — pull request #106 by JBleijenberg (2012-10-24 09:11:24+00:00)
Title: joinUrlRewrtie. Join on non-existing column

joinUrlRewrite() tried to join on a non-existing column in `core_url_rewrite`.
Before the fix, this join was done with the product entity_id, on the entity_id column of core_url_rewrite.
This column does not exists in core_url_rewrite.
I've changed to query to join on product_id in core_url_rewrite.

It also used a conditional statement where type = 2. But column `type` does not exist in core_url_rewrite. I've removed this conditional statement.

Before fix, Magento would throw an exception. After fix, it joins the correct columns