Author Topic: Category pages intermittently show with no child categories  (Read 7302 times)

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Hope some one can help, since updating from VM 3.6.10 to 3.8 whatever (have tried 3.8.2 and 3.8.4) we seem to have an issue whereby some parent category pages load but they are missing all the child categories but you still get the category description, on a refresh the page then loads correctly.  The problem occours intermittently so may not then happen for a day or so.  Happens on multiple categories but only categories with child categories and also with the standard Protostar template.  The issue is resolved by rolling back to VM 3.6.10.

The issue seems to be triggered by the clearing of the virtuemart cache "_virtuemart" but system cache is set to off and the "System - Page Cache" plugin is disabled.

Appreciate any assistance.

Joomla 3.9.19
VirtueMart 3.8.4 10335

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10803
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category pages intermittently show with no child categories
« Reply #1 on: June 30, 2020, 22:46:03 pm »
try turning off the new setting in vm config -> templates :  Use ajax for category content
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #2 on: July 01, 2020, 09:15:42 am »
Thank you for your reply however this was not enabled and has made no difference.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10803
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category pages intermittently show with no child categories
« Reply #3 on: July 01, 2020, 09:43:01 am »
I had this also on one of my clients sites but sadly I can't remember what I did to fix it..  :(
I thought it was the ajax

on the fixed site I also commented the following code - perhaps that what fixed it if u have the same code - the client hasn't reported any further problems

Code: [Select]
// Show child categories
#if ($this->showcategory and empty($this->keyword) && $manu_id == 0) {
#if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
#}
#}
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #4 on: July 01, 2020, 14:44:27 pm »
Hi GJC

Thanks for the reply, it kinda of works however causes problems when using the VM search as it then shows all the categories at the top of the page above the search results.


GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10803
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category pages intermittently show with no child categories
« Reply #5 on: July 01, 2020, 21:10:15 pm »
so if one of these conditions is the cause try just disabling each in turn till you find which is flaky

The client that had this problem doesn't use search so I never noticed the display is "always on"
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #6 on: July 02, 2020, 12:23:57 pm »
Ill have a play with the category template page and see if i can isolate which part of code is causing the issue.  But does it when using the Protostar template so to my understanding this should be using the default VM template files not the customised versions in our template folder.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28602
  • Always on vacation
    • Jenkin Hill Internet
Re: Category pages intermittently show with no child categories
« Reply #7 on: July 02, 2020, 13:37:02 pm »
But does it when using the Protostar template

Which would indicate a configuration issue or an interfering 3rd party plugin/module.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.22 10858  J 3.10.11 PHP 8.0.27

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #8 on: July 03, 2020, 10:19:32 am »
Hi Kelvyn

Thank you for your reply, I will have a look to see if i can work out which plugin is conflicting.  But as there is no error messages or debug information it may take a while.  I wonder if GJC can you advise if the site you had the same issue with had anything but the standard set of Joomla and VM extensions?

Thanks

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10803
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category pages intermittently show with no child categories
« Reply #9 on: July 03, 2020, 13:00:06 pm »
no -- is a very standard site with nothing unusual which is why it had me confused as to the problem.
And again no errors displayed and the problem only shows up once and while if u constantly refresh the cat page.
But it did start with VM3.8.x and if u refreshed the page enough times you would see the subcats disappear... commenting as above appears to have solved it.
No other clients have reported problems with VM3.8.4 but I would say that imho displaying  subcats is quite rare on most sites so maybe it hasn't been noticed as a bug as it only happens perhaps once or twice in 30 refreshes?
And as u found happened on the standard templates as well
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #10 on: July 06, 2020, 15:31:11 pm »
Hi GJC

Thank you for the additional information.  I will try and have a look at what plugins we have and see if any likely to cause conflict.  For now we are just reverting back to 3.6.10.

mrblonde

  • Beginner
  • *
  • Posts: 8
SOLVED: Re: Category pages intermittently show with no child categories
« Reply #11 on: July 08, 2020, 04:29:55 am »
I had this also on one of my clients sites but sadly I can't remember what I did to fix it..  :(
I thought it was the ajax

on the fixed site I also commented the following code - perhaps that what fixed it if u have the same code - the client hasn't reported any further problems

Code: [Select]
// Show child categories
#if ($this->showcategory and empty($this->keyword) && $manu_id == 0) {
#if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
#}
#}

Thanks for the reply, it kinda of works however causes problems when using the VM search as it then shows all the categories at the top of the page above the search results.

Have a client that had this exact same problem with parent categories not showing child categories until the page is refreshed.  I tried GJC Web Design's code and although sort of worked had the same issue with child categories showing above search results.

Took a gamble and tweaked this same code, I found just uncommenting the first IF statement (and a closing }) fixes it:

Code: [Select]
// Show child categories
if ($this->showcategory and empty($this->keyword)) {
# if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
# }
}

Joomla 3.1.19 | VirtueMart 3.8.4 | PHP 7.2.30

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3514
  • VirtueMart Version: 4.0.12.10777
Re: Category pages intermittently show with no child categories
« Reply #12 on: July 08, 2020, 08:52:53 am »
This is the latest in core 3.8.4 10335 for the category default view:

Code: [Select]
// Show child categories
if ($this->showcategory and empty($this->keyword)) {
if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
}
}
Regards
A

Joomla 3.10.11
php 8.0

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10803
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category pages intermittently show with no child categories
« Reply #13 on: July 08, 2020, 09:55:58 am »
so this must be the inconsistent clause

if (!empty($this->category->haschildren))

this problem has only started from VM3.8.4
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3514
  • VirtueMart Version: 4.0.12.10777
Re: Category pages intermittently show with no child categories
« Reply #14 on: July 08, 2020, 11:05:32 am »
I think maybe this is the are for concern

&& $manu_id == 0


if ($this->showcategory and empty($this->keyword) && $manu_id == 0) {

vs the new

if ($this->showcategory and empty($this->keyword)) {

Regards
A

Joomla 3.10.11
php 8.0