Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix Attribute terms sometimes being assigned children #8720

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Commits on Mar 13, 2023

  1. Fix Attribute terms sometimes being assigned children

    Attribute terms (e.g. “Blue”, “Yellow”) have their own `id` property which
    sometimes can overlap with their Taxonomy `id` (e.g. in the test case,
    “Blue” had the same `id` as the “Size” taxonomy), and the function
    building the tree representation for the `SearchListControl` would
    erroneously assign children to it.
    
    To fix this, we do an ugly patch here: we rename the `id` key of
    `AttributeTerm` when changed to a `SearchListItem` to `termId` instead,
    so we can differentiate. We do this because other items passed to
    `SearchListControl` might possibly have several layers of children, but
    we are sure that in the case of terms, we only have on level deep.
    
    This may need a better refactoring at some point.
    sunyatasattva committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    3e36353 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05b9b40 View commit details
    Browse the repository at this point in the history