content_tag(
"label", content +
(required ? " <span class=\"required\">*</span>".html_safe : ""),
- :for => for_tag_id)
+ :for => for_tag_id,
+ :class => custom_value.customized && custom_value.customized.errors[custom_value.custom_field.name].present? ? 'error' : nil)
end
# Return custom field tag with its label tag
def validate_value
custom_field.validate_custom_value(self).each do |message|
- customized.errors.add(:base, custom_field.name + ' ' + message)
+ customized.errors.add(custom_field.name, message)
end
end
end
attribute = attribute.to_i
v = custom_field_values.detect {|v| v.custom_field_id == attribute}
if v && Array(v.value).detect(&:present?).nil?
- errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
+ errors.add(v.custom_field.name, l('activerecord.errors.messages.blank'))
end
else
if respond_to?(attribute) && send(attribute).blank? && !disabled_core_fields.include?(attribute)
)
end
assert_response :success
+
+ assert_select 'label[for=?][class=?]', "issue_custom_field_values_#{field.id}", 'error'
assert_select_error /Database cannot be blank/
end
)
assert_response :success
end
+
+ assert_select 'label[for=?][class=?]', 'issue_due_date', 'error'
+ assert_select 'label[for=?][class=?]', "issue_custom_field_values_#{cf2.id}", 'error'
+
assert_select_error /Due date cannot be blank/i
assert_select_error /Bar cannot be blank/i
end