# Bug SPAR-219 - ActiveRecord::RecordNotFound in  WorkPackages::DatePickerController#show

Project: Stream Planning and Reporting
Status: closed
URL: https://community.openproject.org/work_packages/SPAR-219

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.4.1 |
| Observed in versions | 15.4.0 |
| Bug found in version (deprecated) | 15.4.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

**Steps to reproduce**

*   Click to create a new work package of any type (not sure if milestone types behave differently). Do not yet save the work package
    
*   Click on the date field to open the date picker
    
*   Click on the &quot;Manual&quot; toggle that is already selected.
    

**Buggy behaviour**

*   Full screen 500 error message
    

**Expected behaviour**

*   Clicking on the already selected &quot;Manual&quot; mode should have no effect at all.
    

**Appsignal**

[https://appsignal.com/openproject-gmbh/sites/632371afd2a5e463ef717ecb/exceptions/incidents/6620%5D](https://appsignal.com/openproject-gmbh/sites/632371afd2a5e463ef717ecb/exceptions/incidents/6620%5D)

#### Message

```ruby
Couldn't find WorkPackage with 'id'=new [WHERE "work_packages"."id" IN (SELECT "work_packages"."id" FROM "work_packages" INNER JOIN "projects" ON "projects"."id" = "work_packages"."project_id" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('work_package_tracking') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE)]
```

#### Backtrace

```text
app/controllers/work_packages/date_picker_controller.rb:179 WorkPackages::DatePickerController#find_work_package	
vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:106 block in Multitenancy::Elevators::MappedDomainElevator#call_tenant
```

Appsignal Sample: https://appsignal.com/openproject-gmbh/sites/632371afd2a5e463ef717ecb/exceptions/incidents/6620/samples/632371afd2a5e463ef717ecb-1805318680549186371417423685002
