Jump to content
thirty bees forum
  • 0

Wrong breadcrumbs generation due to deleted categories


Question

Posted

Here is some weird bug. I have the following categories structure:

main category>subcategory1>subcategory2>product

If i just delete subcategory1, subcategory2 may appear randomly in breadcrumbs of the other categories/products.

Here is an example: You had -"main category>subcategory3>subcategory4>product", and if you delete subcategory1 (which is not associated with subcategory 3 or 4, just with the main category, and is a parent category for subcategory2), you may end up with such breadcrumbs

"main category>subcategory3>subcategory4>subcategory2>products".

This orphaned category seem to associate with the other subcategories randomly. It seems like the problem is that if you delete a whole category, subcategories remains undeleted and are still in the database. And there is no option to delete subcategories along with the category (only options to delete/save products).

If you use search bar on the backoffice, you can still find orphaned subcategory, and you can still find it in the database, though parent_id refers to the deleted category (subcategory1) that does not exist anymore.

Also, if you click that subcategory2 in the breadcrumbs, it's still active, and it's still has products on its page. But if you look at that product on the backoffice, it is not associated anymore with subcategory2 (not with any category at all)

5 answers to this question

Recommended Posts

  • 0
Posted

If you have Prestools installed: can you run Integrity Checks? That has a check for categories without valid parents. It cannot repair it but then we at least know for sure what is wrong.

  • 0
Posted

I am not an expert in how to solve this kind of things as I don't know the details of how the software works. I hope someone else who knows will bring in something in. But I will indicate how I would approach the issue: - forget about the products. They are not a problem. You can always attach them to other categories. You can either access them with Prestools' product-solo or by editing another product in the TB backoffice and then changing the product id. - the challenge is to get a coherent tree of categories again. There are two ways to approach that. One is to ignore the unlinked categories. Just make them inactive and move all products attached to them elsewhere. And create new categories to replace them where needed. - a more risky strategy - that I am not certain of whether it will work - is recreating the missing link(s). For this you need to know which categories with which id's are missing. You will need to temporarily remove the auto-increase from the tbcategory table to insert it. And don't forget also to also insert records in tbcategorylang and tbcategory_shop. After you have done this you should immediately randomly insert a category in the shop in order to force it to implement the changes (nleft-nright if you are technical). - anyway: make a backup before you start. And start with just one change and then test whether everything works as it should.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...