The `WorkPackageCollectionEagerLoading` uses eager loading for eager loading CF values that MAY not exist anymore. This results in a faulty query when hitting one of these entries. ``` E, [2017-11-29T17:25:21.847832 #14241] ERROR -- : Grape rescuing from error: API::Errors::NotFound Original error: #<ActiveRecord::RecordNotFound: Couldn't find Version with 'id'=35> Stacktrace: /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/relation/finder_methods.rb:353:in `raise_record_not_found_exception!' /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/relation/finder_methods.rb:479:in `find_one' /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/relation/finder_methods.rb:458:in `find_with_ids' /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/relation/finder_methods.rb:66:in `find' /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/querying.rb:3:in `find' /opt/openproject/vendor/bundle/ruby/2.4.0/gems/activerecord-5.0.4/lib/active_record/core.rb:151:in `find' /opt/openproject/lib/api/v3/work_packages/work_package_collection_representer.rb:228:in `eager_load_custom_values' /opt/openproject/lib/api/v3/work_packages/work_package_collection_representer.rb:216:in `eager_load_version_custom_values' /opt/openproject/lib/api/v3/work_packages/work_package_collection_representer.rb:197:in `full_work_packages' /opt/openproject/lib/api/v3/work_packages/work_package_collection_representer.rb:72:in `initialize' /opt/openproject/app/services/api/v3/work_package_collection_from_query_service.rb:125:in `new' /opt/openproject/app/services/api/v3/work_package_collection_from_query_service.rb:125:in `collection_representer' /opt/openproject/app/services/api/v3/work_package_collection_from_query_service.rb:57:in `results_to_representer' /opt/openproject/app/services/api/v3/work_package_collection_from_query_service.rb:46:in `call' /opt/openproject/lib/api/v3/queries/helpers/query_representer_response.rb:37:in `query_representer_response' /opt/openproject/lib/api/v3/queries/queries_api.rb:91:in `block (3 levels) in <class:QueriesAPI>' ``` https://community.openproject.com/wp/26691pull/6027/head
parent
189eb6ace5
commit
376fa46d4b
Loading…
Reference in new issue