Skip to content

Commit

Permalink
12626: add a fallback message
Browse files Browse the repository at this point in the history
  • Loading branch information
chahmedejaz committed Sep 12, 2024
1 parent 4a38d7e commit c086834
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/admin/products_v3_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ def products_bulk_params
def clone_error_message(error)
case error
when ActiveRecord::RecordInvalid
invalid_field_names = error.record.errors.attribute_names
field_names = error.record.errors.attribute_names
.map{ |field_name| VIEW_FIELD_NAME_MAPPER[field_name] }.join(', ')

t('.invalid_fields_error', invalid_field_names:)
field_names.present? ? t('.invalid_fields_error', field_names:) : t('.error')
else
t('.error')
end
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ en:
clone:
success: Successfully cloned the product
error: Unable to clone the product
invalid_fields_error: "Product being cloned has invalid %{invalid_field_names}"
invalid_fields_error: "Product being cloned has invalid %{field_names}"
product_import:
title: Product Import
file_not_found: File not found or could not be opened
Expand Down

0 comments on commit c086834

Please sign in to comment.