Project

General

Profile

Actions

Defect #35248

open

Hard-coded error messages in IssueStatus

Added by Kam Nazir over 3 years ago. Updated over 3 years ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
I18n
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Untranslated hard-coded string exists in source:trunk/app/models/issue_status.rb@20897#L113

def check_integrity
  if Issue.where(:status_id => id).any?
    raise "This status is used by some issues" 
  elsif Tracker.where(:default_status_id => id).any?
    raise "This status is used as the default status by some trackers" 
  end
end


Files

Screenshot_2021-05-18.png (37.4 KB) Screenshot_2021-05-18.png Go MAEDA, 2021-05-18 08:54
Actions #1

Updated by salman mp over 3 years ago

Also in:

models/role.rb:301:         raise "Cannot delete role" if members.any?
models/role.rb:302:         raise "Cannot delete builtin role" if builtin?
models/role.rb:311:         raise "Unable to create the #{name} role (#{role.errors.full_messages.join(',')})." if role.new_record?
models/setting.rb:330:      raise "There's no setting named #{name}" unless available_settings.has_key?(name)
models/tracker.rb:147:      raise "Cannot delete tracker" if Issue.where(:tracker_id => self.id).any?
models/query.rb:1096:       raise "Unknown #{queried_class.name} association #{assoc}" unless customized_class
models/query.rb:1310:       raise "Unknown query operator #{operator}" 
models/enumeration.rb:135:  raise "Cannot delete enumeration" if self.in_use?

Actions #2

Updated by Holger Just over 3 years ago

  • Status changed from New to Needs feedback

The descriptions of those raised exceptions generally do not show up in the user interface. They are either handled by higher layers of the code (which may then render an appropriate translated error message in the response to the user) or if unhandled result in a 500 error which also doesn't show any further information to the user.

Generally, those exception descriptions only turn up in the application logs (e..g logs/production.log. Here, it is entirely fine to only use english messages (given that the entire code and database scheme uses english).

With that being said, if you can reproduce a case where those error messages do show up in the user interface unchanged, this might be considered for a fix.

Actions #3

Updated by Kam Nazir over 3 years ago

Thank you for your reply, Holger.
This error is shown to the user when he/she try to delete a status that has been used in some issues. something like:
Unable to delete issue status (This status is used by some issues)

I reproduce the scenario and check the Redmine log. There wasn't this error in the log.

Actions #4

Updated by Go MAEDA over 3 years ago

Kam Nazir wrote:

This error is shown to the user when he/she try to delete a status that has been used in some issues. something like:
Unable to delete issue status (This status is used by some issues)

Confirmed the issue. In the screenshot below, you can see an untranslated English sentence in a Japanese error message.

Actions

Also available in: Atom PDF