VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: welrachid on May 07, 2018, 09:41:50 am

Title: Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)
Post by: welrachid on May 07, 2018, 09:41:50 am
Hi guys
I'm using $productModel->getProductsInCategory($id) to retrieve products in a category to show in a mod_virtuemart_category view so that i can show all products in a categories in a listed form. See attachment
However when i upgrade from VirtueMart 3.2.4 to VirtueMart 3.2.14 i get a different result (actually the array is empty)

So i tried to look into the core function of the model and it calls sortSearchListQuery - same arguments as before
When i tried to look at sortSearchListQuery i must admit i cannot really understand the changes or even where to start looking. The function is over 3-400 line long so i cant grasp if old functionality is correct or the new one is.

Can someone please give me a clue?
Should i use an other method to get the product list i want?

Thanks
Wel

ps.
PHP 5.6.x
J! 3.8.6
Title: Re: Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)
Post by: welrachid on May 14, 2018, 22:12:22 pm
Nobody?
 Any lead will be helpful so that i dont have to spend 5 hours looking through VM core code.
Title: Re: Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)
Post by: Milbo on May 24, 2018, 08:46:20 am
search in the product model in the function sortSearchListQuery for this //$this->setDebugSql(1); and enable it. So you can see the actually used sql. Because with your description, nothing is explained.
Title: Re: Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)
Post by: welrachid on May 24, 2018, 09:41:38 am
Hi
Last night i think i found out the problem and was able to fix it.
omitLoaded was true in my configuration in both old version 3.2.4 and in newest 3.2.14 but because the frontpage also displays all products and for some reason the sequence of loading maybe changed? it excluded those product ID's from the resultset.

Good to know that there is a setDebugSql for next time.
thx!