Category pages intermittently show with no child categories

Started by ste-jackson, June 30, 2020, 18:25:13 PM

Previous topic - Next topic

ste-jackson

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

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
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

Thank you for your reply however this was not enabled and has made no difference.

GJC Web Design

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

// 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
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

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

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
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

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

Quote from: ste-jackson on July 02, 2020, 12:23:57 PM
But does it when using the Protostar template

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

Retired from forum life November 2023

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

ste-jackson

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

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
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

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

Quote from: GJC Web Design 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

// 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));
#}
#}


Quote from: ste-jackson on July 01, 2020, 14:44:27 PM
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:

// 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

This is the latest in core 3.8.4 10335 for the category default view:


// 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 4.4.5
php 8.1

GJC Web Design

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
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

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 4.4.5
php 8.1