Author Topic: [SOLVED] Subcategory list drop-down not updated when adding or deleting category  (Read 4135 times)

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Since few releases (currently using 3.0.12 on J 3.4.5, Firefox 42.0) I noticed an issue in subcategory drop-down list when adding or deleting categories.
If you add a new category or delete an old one, that change doesn't immediately appear into the subcategory drop-down list when adding a new category or modifing an old one. So If i add a category then look for it in drop down, it is not there, and if I delete a category I still find it listed in that dropdown.
I have no cache configured in Joomla (previously set to "PHP alternative" but currently disabled), no cache plugins active... this is weird when adding several categories, I have to modify the db table to assign any new one to it's correct parent, or wait until it will appear after long time
Is there a way to solve it?
Regards
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9779
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #1 on: November 23, 2015, 15:04:57 pm »
is it caching?  clear cache?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #2 on: November 23, 2015, 15:57:12 pm »
I wrote in previous post that the cache is NOT activated. I have anyway cleaned that site and the browser cache
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9779
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #3 on: November 23, 2015, 16:14:20 pm »
cats are always cached frontend if switched on or off in Joomla config

is the BE the same.?  see if vm cats files are formed in your cache/ folder
GJC Web Design
VirtueMart and Joomla Developers - php developers http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #4 on: November 24, 2015, 08:45:22 am »
I presume it's a cache problem, but this should not be the right way to get category trees in backend: every time I add a new dir, I must look for cache and delete it, or wait until it will expire...
Could please Max help us to look in the right direction to solve this annoing feature?
I don't see any other report about this, so I can't understand if it's a voluntary designed way to work in BE or if it's a misconfiguration of my installation/webserver (latest Apache 2.4.x).
Any help will be really appreciated
Thank you in advance
Regards
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1418
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #5 on: November 24, 2015, 10:14:30 am »
Quote
I presume it's a cache problem, but this should not be the right way to get category trees in backend: every time I add a new dir, I must look for cache and delete it, or wait until it will expire...
Could please Max help us to look in the right direction to solve this annoing feature?

It is definitely cache.
From my point of view there is no better approach than this.
If the categories are not save into cache then the whole tree has to be re-created every time somebody visits your site.
That means database queries, extra processes, cpu, ram...i.e. time

I don' t know if you are familiar with other systems like Magento.
There everything is cached and for every little change you have to refresh your cache

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9779
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #6 on: November 24, 2015, 10:20:12 am »
perhaps in the getcats function if this is what returns the admin cats

public function getCategories($onlyPublished = true, $parentId = false, $childId = false, $keyword = "", $vendorId = false)

around line 363  \administrator\components\com_virtuemart\models\category.php

$app = JFactory::getApplication ();
      
               if(!isset($cats[$hash]) || $app->isAdmin()){
         $cats[$hash] = $this->_category_tree = $this->exeSortSearchListQuery(0,$select,$joinedTables,$whereString,'GROUP BY virtuemart_category_id',$ordering );
      }

???  not tested in any way
GJC Web Design
VirtueMart and Joomla Developers - php developers http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #7 on: November 24, 2015, 10:32:41 am »
Quote
I don' t know if you are familiar with other systems like Magento.
There everything is cached and for every little change you have to refresh your cache

I usually work on Magento too, for more complex sites.
But Magento has the clear cache function specifically forged to that purpose.
In my VM installation, I have ALL site caches OFF. How to clear the BE cat cache in that situation? I can't see any specific VM function to be used for.
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27846
  • Always on vacation
    • Jenkin Hill Internet
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #8 on: November 24, 2015, 10:40:18 am »
I have used this for sites where caching is an issue:  http://extensions.joomla.org/extension/cache-cleaner

It has a useful setting:  Cleans the cache if you save (or apply) something
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 VM 3.8.4.10335 on Joomla 3.9.21 PHP 7.4.9

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #9 on: November 24, 2015, 10:44:11 am »
Thank you jenkinhill, I'll give it a try.
But I suggest Max to consider this tread like a "feature request": VM backend should have it's proper way to clear cache, without the needing of using another extension :)
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1418
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #10 on: November 24, 2015, 11:30:29 am »
You don't need a 3rd party to clean your cache.
Cache is a joomla component and has it's own section in the joomla backend
System > Clear Cache

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3262
  • VirtueMart Version: 3.8.4
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #11 on: November 24, 2015, 11:54:53 am »
Exactly - Joomla has this capability built in!
regards
A

Joomla 3.9.20
php 7.3

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27846
  • Always on vacation
    • Jenkin Hill Internet
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #12 on: November 24, 2015, 12:12:26 pm »
The advantage with the plugin is that you don't have to take any other steps, you just save or apply whatever you are doing and the cache is automatically cleared.
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 VM 3.8.4.10335 on Joomla 3.9.21 PHP 7.4.9

SteP[IT]

  • Jr. Member
  • **
  • Posts: 199
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.4.3
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #13 on: November 24, 2015, 12:24:26 pm »
uhm... do you read my post??? I have NO cache activated (no plugin, no joomla configurable cache, NOTHING). I can't simply clear the cache, I HAVE NO CACHE to delete.
Joomla cache is deactivated, template caches and plugin ones too...
It's an admin side problem, for me.
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9779
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Subcategory list drop-down not updated when adding or deleting category
« Reply #14 on: November 24, 2015, 12:45:16 pm »
I wonder if YOU read our posts?

the cats cache is on and there... there is no config for it and the Joomla settings have nothing to do with it

look in your cache folder!  what do u see?  a folder com_virtuemart_cats with cached cats

why are u so stubborn? I suggested a fix.. did u try it?
otherwise Jenks suggested a plugin that puts a button at the top of your admin page where u can dump the cache.. have u tried it?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation