Project

General

Profile

Bug #4557

"Undefined Method" is raised in FiltersHelper#resource_path when resource is defined in a namespaced plugin

Added by Dmitri Dolguikh about 5 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
Authorization
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Backtrace:

ActionView::Template::Error (undefined method `foreman_setup/provisioners_path' for #<#<Class:0x007fd081927030>:0x007fd084404cd0>):
45:
46: <%= autocomplete_f f, :search,
47: :disabled => f.object.unlimited?,
48: :path => resource_path(f.object.resource_type), :control_group_id => 'search_group' %>
49: </div>
50: </div>
51:
app/helpers/filters_helper.rb:20:in `resource_path'


Related issues

Has duplicate Foreman - Bug #4554: Editing filter on namespaced resource type fails with undefined method `foreman_setup/provisioners_path'Duplicate2014-03-05
Has duplicate Foreman - Bug #4603: RBAC UI - plugin permissions not properly foundDuplicate2014-03-09
Blocks Foreman - Tracker #4552: New permissions/authorization system issuesNew

Associated revisions

Revision 35da973f (diff)
Added by Dmitri Dolguikh about 5 years ago

fixes #4557: namespaced and mounted plugins no longer cause crash on the filter screen

History

#1 Updated by Dominic Cleal about 5 years ago

  • Blocks Tracker #4552: New permissions/authorization system issues added

#2 Updated by Dominic Cleal about 5 years ago

  • Has duplicate Bug #4554: Editing filter on namespaced resource type fails with undefined method `foreman_setup/provisioners_path' added

#3 Updated by Marek Hulán about 5 years ago

I thought it was resolved in katello patch, here's the snippet that should do the trick

object_path = f.object.resource_type.pluralize.underscore
if object_path.include?('/')
  prefix, suffix = object_path.split('/', 2)
  send(prefix).send(suffix + '_path')
else
  send("#{object_path}_path")
end

a FilterHelper#resource_path (app/helpers/filters_helper.rb) should be adapted to this snippet, that should fix it

#4 Updated by Dmitri Dolguikh about 5 years ago

  • Status changed from Assigned to Ready For Testing

#5 Updated by Dominic Cleal about 5 years ago

  • Has duplicate Bug #4603: RBAC UI - plugin permissions not properly found added

#6 Updated by Dominic Cleal about 5 years ago

  • Legacy Backlogs Release (now unused) set to 4

#7 Updated by Anonymous about 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF