# Bug COSTS-45 - Error on applying filter changes in Cost Reports

Project: Stream Time & Costs
Status: closed
URL: https://community.openproject.org/work_packages/COSTS-45

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 15.2.1 |
| Observed in versions | 15.0.0 |
| Bug found in version (deprecated) | 15.0.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Andrej Sandorf |
| 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.  Login as a user with permissions to run cost reports (including full admins)

2.  Go to the cost reports page of a project

3.  Select a date range or last x days and user for labor cost filtering then hit `apply` to show the users' labor costs itemized

4.  Observe message stating `There was an error handling the query.`

### What is the buggy behavior?

  - Application logs say this is happening in:

<!-- end list -->

``` ruby
NoMethodError (undefined method 'migrate' for nil):
modules/reporting/app/controllers/cost_reports_controller.rb:165:in 'update'
```

  - Somehow `@query` appears to be nil

### What is the expected behavior?

1.  Cost reports run correctly

2.  Budgets show cost breakdowns as they did before v15 (presuming its related)

### Environment information

**OpenProject installation type**

  - Packaged installation
    
      - Arch

**OpenProject version**

*v15.0.2*

**Browser**

- [x] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [ ] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [x] Linux (Arch)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

English
