VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: behemoth on June 20, 2019, 13:52:17 PM

Title: Category as its own parent
Post by: behemoth 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.
Title: Re: Category as its own parent
Post by: Jörgen on June 20, 2019, 14:23:45 PM
Go into phpmyadmin and change it in xxxx_virtuemart_category_categories.

Jörgen @ Kreativ Fotografi
Title: Re: Category as its own parent
Post by: behemoth 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'
Title: Re: Category as its own parent
Post by: Milbo on June 20, 2019, 15:51:35 PM
Thx, fixed by adding

if($data['category_parent_id'] == $data['virtuemart_category_id']){
$data['category_parent_id'] = 0;
}