Skip to content

Commit

Permalink
Merge pull request #1255 from lpichler/fix_vca_with_underscore
Browse files Browse the repository at this point in the history
Fix virtual custom attribute column with underscore when it is added
(cherry picked from commit f7613d6)

https://bugzilla.redhat.com/show_bug.cgi?id=1458341
  • Loading branch information
Martin Povolny authored and simaishi committed Jun 2, 2017
1 parent 32e04d6 commit c79d35a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/report_controller/reports/editor.rb
Expand Up @@ -1156,10 +1156,13 @@ def add_field_to_col_order(rpt, field)
if field.include?("__") # Check for pivot calculated field
f = field.split("-")[1].split("__").first # Grab the field name after the hyphen, before the "__"
rpt.cols.push(f) unless rpt.cols.include?(f) # Add the original field, if not already there
rpt.col_order.push(field.split("-")[1]) # Add the field to the col_order array
else
rpt.cols.push(field.split("-")[1]) # Grab the field name after the hyphen
field_column = MiqExpression::Field.parse(field).column
rpt.cols.push(field_column)
rpt.col_order.push(field_column) # Add the field to the col_order array
end
rpt.col_order.push(field.split("-")[1]) # Add the field to the col_order array

if field == sortby1 # Is this the first sort field?
rpt.sortby = [@edit[:new][:sortby1].split("-")[1]] + rpt.sortby # Put the field first in the sortby array
elsif field == sortby2 # Is this the second sort field?
Expand Down

0 comments on commit c79d35a

Please sign in to comment.