[Skip to main content](#vessel-content)

#   Database nested set model problems in category tab

##

- **[Cedwyn](/forum/user/31495-cedwyn "View Cedwyn's Profile")**
- [![Cedwyn's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31495-cedwyn "View Cedwyn's Profile") Topic Author
- [ Offline](/forum/user/31495-cedwyn)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 9 months ago -  10 years 9 months ago [\#226623](#226623) by [Cedwyn](/forum/user/31495-cedwyn "View Cedwyn's Profile")  *[Database nested set model problems in category tab](/forum/25-install-update/881582-database-nested-set-model-problems-in-category-tab#226623 "-- HikaShop version -- : latest  Backend: &quot;Check Database&quot; returns &quot;ok&quot;. &quot;Rebuild&quot; category doesn't fix this.  Under &#95;&#95;hikashop&#95;category, several categories are set to 0 for category&#95;left and &#95;right.  There are also a number of categories that display at the root tree even though their parent is set correctly.  A category is set up with a category&#95;order of 2 of 4 but has a left/right value indicating that it is placed last in the tree: Category / Order / Left / Right Cat A / 1 / 100 / 101 Cat B&#42; / 2 / 106 / 107 Cat C / 3 / 102 / 103 Cat D / 4 / 104 / 105  So in the above example, Category B is ordered 2nd but has a left/right nest that places it at the end of the model structure.  SO: I am hoping I can do something like deleting the left/right values in the database, then hitting rebuild on the backend ui and have the database fix itself. Or perhaps you have a script that will do this for me - I can just make one, but figured I'd ask first.  Thanks")* was created by *[Cedwyn](/forum/user/31495-cedwyn "View Cedwyn's Profile")*

-- HikaShop version -- : latest

Backend: "Check Database" returns "ok". "Rebuild" category doesn't fix this.

Under __hikashop_category, several categories are set to 0 for category_left and _right.

There are also a number of categories that display at the root tree even though their parent is set correctly.

A category is set up with a category_order of 2 of 4 but has a left/right value indicating that it is placed last in the tree:
Category / Order / Left / Right
Cat A / 1 / 100 / 101
Cat B* / 2 / 106 / 107
Cat C / 3 / 102 / 103
Cat D / 4 / 104 / 105

So in the above example, Category B is ordered 2nd but has a left/right nest that places it at the end of the model structure.

SO: I am hoping I can do something like deleting the left/right values in the database, then hitting rebuild on the backend ui and have the database fix itself. Or perhaps you have a script that will do this for me - I can just make one, but figured I'd ask first.

Thanks

Last edit: 10 years 9 months ago by [Cedwyn](/forum/user/31495-cedwyn "View Cedwyn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg4MTU4Mi1kYXRhYmFzZS1uZXN0ZWQtc2V0LW1vZGVsLXByb2JsZW1zLWluLWNhdGVnb3J5LXRhYj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

10 years 9 months ago [\#226673](#226673) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Database nested set model problems in category tab](/forum/25-install-update/881582-database-nested-set-model-problems-in-category-tab#226673 "-- HikaShop version -- : latest  Backend: &quot;Check Database&quot; returns &quot;ok&quot;. &quot;Rebuild&quot; category doesn't fix this.  Under &#95;&#95;hikashop&#95;category, several categories are set to 0 for category&#95;left and &#95;right.  There are also a number of categories that display at the root tree even though their parent is set correctly.  A category is set up with a category&#95;order of 2 of 4 but has a left/right value indicating that it is placed last in the tree: Category / Order / Left / Right Cat A / 1 / 100 / 101 Cat B&#42; / 2 / 106 / 107 Cat C / 3 / 102 / 103 Cat D / 4 / 104 / 105  So in the above example, Category B is ordered 2nd but has a left/right nest that places it at the end of the model structure.  SO: I am hoping I can do something like deleting the left/right values in the database, then hitting rebuild on the backend ui and have the database fix itself. Or perhaps you have a script that will do this for me - I can just make one, but figured I'd ask first.  Thanks")*

Hi,

The rebuild button will indeed set back the left/right automatically.
If some of the categories left and right are set to 0, it likely means that these categories are not reachable from the main category tree.
Check their category_parent_id. It must be set with the id of a category of the tree. The rebuild system bases itself on that to reset the left/right automatically.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg4MTU4Mi1kYXRhYmFzZS1uZXN0ZWQtc2V0LW1vZGVsLXByb2JsZW1zLWluLWNhdGVnb3J5LXRhYj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.125 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
