# Bug OP-15656 - Custom field filter in project list causes internal server error when opening it

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.4.1 |
| Observed in versions | 14.4.0 |
| Sprint | 14.4.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 14.4.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 | Attila Dombi |
| 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.  Go to the projects list view
    
2.  Create a new project list with a custom field filter (e.g. slack webhook URL) and save it (see screenshot)
    
3.  Try opening the saved project list after it was saved
    

### What is the buggy behavior?

*   the list cannot be viewed, an internal server error is shown instead
    

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

### What is the expected behavior?

*   the project list show open normally
    

### **Logs**

```ruby
app/models/queries/projects/filters/custom_field_context.rb:57:in `where_subselect_conditions': undefined method `user' for nil (NoMethodError)

      allowed_project_ids = Project.allowed_to(context.user, :view_project_attributes)
                                                      ^^^^^
        from app/models/queries/filters/shared/custom_fields/base.rb:120:in `condition'
        from app/models/queries/filters/shared/custom_fields/list_optional.rb:56:in `condition'
        from app/models/queries/filters/shared/custom_fields/base.rb:105:in `where'
        from app/models/queries/filters/base.rb:106:in `apply_to'
        from app/models/queries/base_query.rb:191:in `block in apply_filters'
        from app/models/queries/base_query.rb:190:in `each'
        from app/models/queries/base_query.rb:190:in `inject'
        from app/models/queries/base_query.rb:190:in `apply_filters'
        from app/models/queries/base_query.rb:66:in `results'
```

### Screenshots and other files

New project list with custom field filter example:

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

### Environment information

_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_

**OpenProject installation type**

*   [x] Hosted cloud edition
*   [ ] Packaged installation
    *   What distribution?
        
*   [ ] Docker All-in-one container
*   [ ] Docker-compose installation
*   [ ] Other (please specify)

**OpenProject version**

_v14.4_

_First mentioned in support ticket 18566_
