Project

General

Profile

Actions

Defect #14077

closed

Exception in 2.3.1 undefined method `&' for "0":String in app/models/tracker.rb (with possible fix)

Added by c pg over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Cant reproduce
Affected version:

Description

just updated to ruby 1.9.3 and 2.3.1. Started getting a few exceptions.

Here is one:

ActionView::Template::Error (undefined method `&' for "0":String):
    36:   rows.left l(:field_status), h(@issue.status.name), :class => 'status'
    37:   rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
    38:
    39:   unless @issue.disabled_core_fields.include?('assigned_to_id')
    40:     rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
    41:   end
    42:   unless @issue.disabled_core_fields.include?('category_id')
  app/models/tracker.rb:72:in `block in disabled_core_fields'
  app/models/tracker.rb:72:in `select'
  app/models/tracker.rb:72:in `disabled_core_fields'
  app/models/issue.rb:460:in `disabled_core_fields'
  app/views/issues/show.html.erb:39:in `block in _app_views_issues_show_html_erb___3689670651647187124_55351200'
  app/helpers/issues_helper.rb:144:in `issue_fields_rows'

what i did with some minimal guesswork, and seems to (maybe) work, is:

-    @disabled_core_fields ||= CORE_FIELDS.select { i += 1; (fields_bits || 0) & (2 ** i) != 0}
+    @disabled_core_fields ||= CORE_FIELDS.select { i += 1; (fields_bits.to_i || 0) & (2 ** i) != 0}

i did not see this reported and i do not think i missed anything in upgrading.

also, i did not see this fixed in this area of the code (though it may be fixed somewhere else, course).

i am running this on an instance on my Amahi server.

Actions #1

Updated by Etienne Massip over 11 years ago

  • Category set to Issues
Actions #2

Updated by Jean-Philippe Lang over 11 years ago

  • Resolution set to Cant reproduce

Works for me. The fields_bits column is numeric, and .to_i should not be needed.

Actions #3

Updated by c pg over 11 years ago

  • Status changed from New to Resolved

reinstalled the sources from git and i am not getting this any more. strange. closing.

Actions #4

Updated by Toshi MARUYAMA over 11 years ago

  • Status changed from Resolved to Closed

Thank you for your feedback.

Actions

Also available in: Atom PDF