# Bug OP-1259 - openproject-costs plugin causes error 500

Project: OpenProject
Status: rejected
URL: https://community.openproject.org/work_packages/OP-1259

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions |  |
| Observed in versions |  |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| 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 |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

When enabling the openproject-costs plugin creating/viewing a work package produces an internal server error (500).

Here is the log message:

    Started GET "/work_packages/1" for 95.91.169.17 at 2014-04-22 12:11:04 +0200
    Processing by WorkPackagesController#show as HTML
      Parameters: {"id"=>"1"}
    OpenProject User: admin #john.doe# (admin ID: 1 <john.doe>)
      Rendered /home/openproject/.rvm/gems/ruby-2.1.0/bundler/gems/openproject-costs-30c2cc833aef/app/views/hooks/costs/_view_work_package_show_action_menu.html.erb (2.6ms)
      Rendered work_packages/_action_menu.html.erb (12.1ms)
      Rendered layouts/_action_menu_base.html.erb (0.3ms)
      Rendered layouts/_action_menu_specific.html.erb (0.9ms)
      Rendered accessibility/_empty_element_tag.html.erb (0.2ms)
      Rendered work_packages/show.html.erb within layouts/base (62.6ms)
    Completed 500 Internal Server Error in 101.2ms
    
    ActionView::Template::Error (undefined method `attribute' for nil:NilClass):
        51:
        52:   <div class="issue details">
        53:     <div class="meta">
        54:       <% attributes = work_package_show_attributes(work_package) %>
        55:       <div id="left" style="float:left; width:50%;">
        56:         <table class="attributes">
        57:           <% attributes[:left].each do |attribute| %>
      lib/redmine/hook.rb:73:in `block (2 levels) in call_hook'
      lib/redmine/hook.rb:73:in `each'
      lib/redmine/hook.rb:73:in `block in call_hook'
      lib/redmine/hook.rb:70:in `tap'
      lib/redmine/hook.rb:70:in `call_hook'
      lib/redmine/hook.rb:174:in `call_hook'
      app/helpers/work_packages_helper.rb:624:in `hook_attributes'
      app/helpers/work_packages_helper.rb:337:in `work_package_show_attribute_list'
      app/helpers/work_packages_helper.rb:348:in `work_package_show_attributes'
      app/views/work_packages/show.html.erb:54:in `_app_views_work_packages_show_html_erb___1478936894131064064_70124315021180'
      app/controllers/work_packages_controller.rb:65:in `block (2 levels) in show'
      app/controllers/work_packages_controller.rb:63:in `show'

Our deployment is based on stable branches (OP + plugins).
