# Feature OP-13007 - Retain sort order in work packages table for intermediate parents not contained in result set

Project: OpenProject
Status: new
URL: https://community.openproject.org/work_packages/OP-13007

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Wish List |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  create 7 work-packages (see screenshot)
2.  create view (hierarchy active + sort by subject)

### What is the buggy behavior?

*   Sorting by subject does not work

### What is the expected behavior?

*   level-order sorting with hiearchy enabled
    *   nodes added via filter
    *   nodes added via the hierarchy feature

### Screenshots and other files

*   correct order:
    *   33350
        *   33372
            *   33568
        *   33534 (swapped with 33400)
            *   31716
        *   33400 (swapped with 33534)
            *   33636
*   Note: if there are multiple leaf nodes (i.e. 33568, 33636, 31716) under the same parent, those are sorted correctly, the issue is with the &quot;virtual&quot; nodes added to the work-package view by the hierarchy feature (represented by the button with the steps next to &quot;SUBJECT&quot;)

_<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/64022/content">_

**OpenProject installation type**

*   [x] Packaged installation
    *   Debian

**OpenProject version**

*   [x] _12.5.7_

**Browser**

*   [x] Edge
