Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)

Started by welrachid, May 07, 2018, 09:41:50 AM

Previous topic - Next topic

welrachid

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
Best regards,
Wel

welrachid

Nobody?
Any lead will be helpful so that i dont have to spend 5 hours looking through VM core code.
Best regards,
Wel

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

welrachid

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!
Best regards,
Wel