# Bug OP-9676 - Only last N projects available for parent project selection

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-9676

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 12.0.7 |
| Observed in versions | 12.0.0 |
| Sprint | 12.0.7 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.0.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Environment**:

Your OpenProject Version: 12.0.5

### **Steps to reproduce:**

1.  Choose N and set the minimum objects per page under Admin -\> System Settings -\> General to N (e.g. 5)
2.  Create N + 1 projects
3.  Create a new project and try to set the first project you created in step 1 as its parent (without going to said project first)

Note: the same issues applies when trying to change an existing project's parent.

### **Actual Behavior**

Only the N most recently created projects are offered in the parent selection.

### **Expected Behavior**

Every suitable project should be offered.

**Discussion**

When loading the project settings or creating a new project the available projects API is called without any filters once. It just returns all projects. Since it's paginated, it only returns the last N.

This result then is filtered client-side in the parent selection auto completer.

Instead when the user types in the auto-completer the available projects API should be called with the user's query as a project name filter.
