# Bug OP-17366 - When a hierarchy cf value is deleted in Administration, the old value still applies in wp and prevents updating

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Administration / Custom fields, Modules and project features / Work packages |
| Target versions | 17.0.0 |
| Observed in versions |  |
| Sprint | 17.0.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| 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 | Eric Schubert |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Login as admin and go to Administration/Custom fields
    
2.  Make sure you have a cf of type Hierarchy with some items and sub items
    
3.  Go to a work package that has the custom field and select a value (one of the sub items for example)
    
4.  Go back to Administration/Custom fields and edit your custom field by deleting the same sub item you selected in your work package
    
5.  Go to the wp list and try to update your wp (change its priority for example)
    

### What is the buggy behavior?

*   There is a message saying: X (custom field name) is invalid but while deleting the sub item there was a confirmation pop-up with this message
    

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

### What is the expected behavior?

1.  Based on the above message, I would expect the value to be removed when I delete this sub item.
    

### Environment information

**OpenProject version**

_16.1_
