Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. missing required keys: [:id]) when viewing work packages

missing required keys: [:id]) when viewing work packages

Added by Deleted user about 8 years ago

I am currently migrating from Redmine to Openproject and I am receiving the following error when viewing work packages:

ActionController::UrlGenerationError (No route matches {:action=>"update", :controller=>"api/experimental/queries", :id=>#<Query id: nil, project_id: 229, name: "_", filters: [#<Queries::WorkPackages::Filter::StatusFilter:0x0000000cfee848 @context=#<Project id: 229, name: "INSG IT-Archeologie ", description: "", is_public: false, parent_id: nil, created_on: "2016-11-28 10:21:20", updated_on: "2016-11-28 10:21:20", identifier: "insg-it-archeologie", status: 1, lft: 115, rgt: 116, project_type_id: nil, responsible_id: nil, work_packages_responsible_id: nil>, @operator="o", @values=[], @name=:status_id>], user_id: 0, column_names: [], sort_criteria: [], group_by: nil, is_public: true, display_sums: false>, :layout=>nil, :project_id=>"insg-it-archeologie"} missing required keys: [:id]):

app/controllers/api/experimental/concerns/query_loading.rb:107:in `block in allowed_links_on_query'
app/controllers/api/experimental/concerns/query_loading.rb:100:in `tap'
app/controllers/api/experimental/concerns/query_loading.rb:100:in `allowed_links_on_query'
app/controllers/api/experimental/work_packages_controller.rb:83:in `query_as_json'
app/controllers/api/experimental/work_packages_controller.rb:51:in `index'
app/middleware/reset_current_user.rb:47:in `call'
  Rendering /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
  Rendering /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.text.erb
  Rendered /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.text.erb (0.7ms)
  Rendering /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
  Rendered /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.9ms)
  Rendering /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
  Rendered /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (1.8ms)
  Rendered /usr/local/bundle/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb (67.4ms)
I have already looked into the issue and found out that the query object isn't being saved before being passed to the api_experimental_query_path() method. This method needs an id. If I call query.save or comment out the lines it works.

Following lines in app/controllers/api/experimental/concerns/query_loading.rb are affected:

      #links[:update]      = api_experimental_query_path(query) if auth.allowed?(query, :update)
      #links[:delete]      = api_experimental_query_path(query) if auth.allowed?(query, :destroy)
      #links[:publicize]   = api_experimental_query_path(query) if auth.allowed?(query, :publicize)
      #links[:depublicize] = api_experimental_query_path(query) if auth.allowed?(query, :depublicize)

Openproject version: 6.1.4 but it happens with 5.0 too

Are these lines important? What do they do?

Please tell me if I can help with any further information


Loading...