Author Topic: Category as its own parent  (Read 1243 times)

behemoth

  • Jr. Member
  • **
  • Posts: 81
Category as its own parent
« on: June 20, 2019, 13:52:17 pm »
If you create a category and set its 'Parent Category' to itself, it vanishes from the Product Categories list.

If you browse to it at the front end you get a warning "Stopped getCategoryRecurse after 10 rekursions" which makes sense, but you can't go into the category in the back end to fix it.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3933
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Category as its own parent
« Reply #1 on: June 20, 2019, 14:23:45 pm »
Go into phpmyadmin and change it in xxxx_virtuemart_category_categories.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

behemoth

  • Jr. Member
  • **
  • Posts: 81
Re: Category as its own parent
« Reply #2 on: June 20, 2019, 14:54:20 pm »
It's not a problem I currently have; I was fortunate enough to have another browser window open with it still in, but it just seems like 'undocumented behaviour'

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10530
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Category as its own parent
« Reply #3 on: June 20, 2019, 15:51:35 pm »
Thx, fixed by adding
Code: [Select]
if($data['category_parent_id'] == $data['virtuemart_category_id']){
$data['category_parent_id'] = 0;
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/