Author Topic: Changed behaviour in productModel -> sortSearchListQuery (3.2.4 => 3.2.14)  (Read 300 times)

welrachid

  • Jr. Member
  • **
  • Posts: 248
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
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

  • Jr. Member
  • **
  • Posts: 248
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Nobody?
 Any lead will be helpful so that i dont have to spend 5 hours looking through VM core code.
Best regards,
Wel

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9667
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

welrachid

  • Jr. Member
  • **
  • Posts: 248
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
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