Magento 1

Upgrade from 1.6 to 1.9 PDOException’ with message ‘SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e.0’ in ‘on clause” in lib/Zend/Db/Statement/Pdo.php:228

We’ve just upgraded one of our e-commerce websites which uses Magento version 1.5. We upgraded it to the latest 1.9.0.1. Really lots and lots of bug fixes to be done and one of them is what’s the title of this post.

Anyways, you can fix it by going to Mage_Reports_Model_Resource_Product_Collection::setProductEntityId and remove the (int) because it’s trying to convert the string into integer. This is not the best fix but we’re in a hurry so if you found something that is more appropriate then please leave a comment.

public function setProductEntityId($entityId)
{
$this->_productEntityId = (int)$entityId;
return $this;
}