# Bug OP-20918 - ActionView::Template::Error in Admin::Settings::WorkPackageCustomFieldsController#projects

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Administration / Custom fields, Administration / Work package administration |
| Target versions |  |
| Observed in versions | 18.1.0 |
| Sprint |  |
| 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 | Klaus Zanders |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Visit the page `https://qa.openproject-edge.com/admin/settings/work_package_custom_fields/154/projects`
    

### What is the buggy behavior?

*   An 500 error is thrown, see below.
    

### What is the expected behavior?

1.  Render the page without an error.
    

### **Logs**

**Appsignal:** https://appsignal.com/openproject-gmbh/sites/673aff9f83eb6776b27e7743/exceptions/incidents/2627/traces/last

```text
undefined method 'descendants' for nil
BACKTRACE

Application backtrace

Full backtrace
app/models/custom_field/project_specific_values.rb:44 CustomField::ProjectSpecificValues#restrictable_values
app/models/custom_field/project_specific_values.rb:105 CustomField::ProjectSpecificValues#project_value_counts
app/views/admin/settings/work_package_custom_fields/projects.html.erb:92
app/views/admin/settings/work_package_custom_fields/projects.html.erb:45
```

### Note

This seems to be happening on 18.1 and not on 18.0

See further occurrences: https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1839/traces/last?overlay=search&amp;q=action%3AAdmin%3A%3ASettings%3A%3AWorkPackageCustomFieldsController%23projects&amp;sampleType=EXCEPTION&amp;timeframe=all
