You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the calculation of the mpath for the product categories when the parent_category_id remains unchanged. This affects scenarios where the grandparent category changes but the immediate parent category does not, leading to incorrect mpath values for the affected categories' descendants.
This issue causes problems with querying category data, particularly when using the include_ancestors_tree or include_descendants_tree query parameters, as the mpath does not reflect the correct hierarchical relationship after changes to the grandparent category.
System information:
Medusa version (including plugins): v2.0
Node.js version: v20.15.1
Database: Postgres v16
Operating system: Linux
Steps to reproduce the behavior:
Create a category tree with at least three levels: Grandparent → Parent → Child.
Using the edit ranking feature in Medusa Admin move the Parent (along with Child) under another category.
Observe that while the mpath of the parent is updated correctly as its immediate parent was changed, but the child category’s mpath remains unchanged, the mpath still starts with previous grandparent's id.
Expected behavior:
When the grandparent category is updated, the mpath of all descendant categories (including children and grandchildren) should be updated to reflect the new hierarchical structure.
Impact:
Queries using the include_ancestors_tree parameter return incorrect results due to incorrect mpath calculation.
Data inconsistency in category hierarchy can lead to broken functionality in areas relying on accurate category trees.
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug:
There is a bug in the calculation of the mpath for the product categories when the parent_category_id remains unchanged. This affects scenarios where the grandparent category changes but the immediate parent category does not, leading to incorrect mpath values for the affected categories' descendants.
This issue causes problems with querying category data, particularly when using the include_ancestors_tree or include_descendants_tree query parameters, as the mpath does not reflect the correct hierarchical relationship after changes to the grandparent category.
System information:
Medusa version (including plugins): v2.0
Node.js version: v20.15.1
Database: Postgres v16
Operating system: Linux
Steps to reproduce the behavior:
Expected behavior:
When the grandparent category is updated, the mpath of all descendant categories (including children and grandchildren) should be updated to reflect the new hierarchical structure.
Impact:
The text was updated successfully, but these errors were encountered: