From ce12405c36beb40b959d55fad7b5a8344b299d68 Mon Sep 17 00:00:00 2001 From: Gusa Date: Sat, 15 Dec 2012 03:54:17 +0100 Subject: [PATCH] Fixed error: finding ads but not user association. --- lib/model/doctrine/AdDescriptionTable.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/model/doctrine/AdDescriptionTable.class.php b/lib/model/doctrine/AdDescriptionTable.class.php index d21111c..eaa69cb 100644 --- a/lib/model/doctrine/AdDescriptionTable.class.php +++ b/lib/model/doctrine/AdDescriptionTable.class.php @@ -102,7 +102,7 @@ class AdDescriptionTable extends Doctrine_Table { try { - $adIds[] = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne( + $auxAdId = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne( "SELECT ad.id FROM ad INNER JOIN company_category ON (ad.company_categ_id=company_category.id) INNER JOIN general_category ON (company_category.general_categ_id=general_category.id) INNER JOIN user_basket ON (user_basket.general_categ_id=general_category.id) @@ -114,6 +114,11 @@ class AdDescriptionTable extends Doctrine_Table //In case of error return as soon as posible. return null; } + + if (!empty($auxAdId)) + { + $adIds[] = $auxAdId; + } } if (empty($adIds)) { -- 2.1.4