#1 ✓resolved
James

Unhandled exception raised when no metadata exists for a license

Reported by James | October 30th, 2008 @ 03:15 PM

Summary

When a license with no metadata value present, and the license is selected on an item (in Kete, for example), the acts_as_licensed plugin causes an uncaught exception to be raised, resulting in a error 500 in a production website.

Stack trace


ActionView::TemplateError (private method `gsub' called for nil:NilClass) on line #2 of topics/_license.html.erb:
1: <% cache_with_privacy(item, {:part => "secondary_content_license_metadata"}) do -%>
2: <% unless item.license_metadata.nil? -%>
3: <div class="secondary-content-section-wrapper">
4:   <div id="license-box" class="secondary-content-section">
5:     <div class="license"><%= item.license_metadata %></div>

    vendor/plugins/acts_as_licensed/lib/acts_as_licensed.rb:55:in `license_metadata'
    app/views/topics/_license.html.erb:2:in `_run_erb_47app47views47topics47_license46html46erb'
    vendor/rails/actionpack/lib/action_controller/caching/fragments.rb:72:in `call'
    vendor/rails/actionpack/lib/action_controller/caching/fragments.rb:72:in `fragment_for'
    vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:50:in `cache_fragment'
    vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb:36:in `cache'
    app/helpers/application_helper.rb:795:in `cache_with_privacy'

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Acts As Licensed is a plugin which provides a basic content licensing system to community centred Ruby On Rails applications. The plugin includes a set of Creative Commons New Zealand and Australian licenses, which can be imported (excluding the No Derivative Works variant).

People watching this ticket

Pages