View Issue Details

IDProjectCategoryView StatusLast Update
0027241mantisbtlocalizationpublic2020-09-25 19:36
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Target Version2.25.0Fixed in Version2.25.0 
Summary0027241: Improve handling of missing language strings
Description

When a language string is missing, MantisBT currently displays an empty string

Additionally, if $g_display_error settings for E_USER_WARNING are set to DISPLAY_ERROR_INLINE, an alert is displayed on screen, e.g.

APPLICATION WARNING #300: String "add_profile" not found. (in '/home/dregad/dev/mantisbt/core/lang_api.php' line 307)

So we know which string is missing, but not where it was referenced as the error is always triggered from Lang API.

Even though it is not a normal scenario to have missing strings, this behavior is not very user-friendly to

  • the user, who is missing information to use the system (e.g. a button label)
  • the admin/developer, who does not know where to look to get context and fix the problem
TagsNo tags attached.

Activities

Related Changesets

MantisBT: master 6ef1734d

2020-09-05 06:45:49

dregad

Details Diff
Print lang string if English localization missing

When an English language string is missing, MantisBT currently displays
an empty string; this is not very friendly to the user, who may be
missing important information (e.g. a button label).

If English string is missing, display the language string itself
(i.e. the $p_string parameter to lang_get()).

Fixes 0027241
Affected Issues
0027241
mod - core/lang_api.php Diff File

MantisBT: master 60004349

2020-09-06 08:49:07

dregad

Details Diff
Special handling for missing lang string errors

If the error type is 300 (ERROR_LANG_STRING_NOT_FOUND), we retrieve the
details (file name and line number) of the parent error. Properly
handles the case when user's language is not English, by going through
the error stack trace until the first lang_get() call is found.

This allows printing information about the actual location of the
missing string, instead of a not-so-useful reference to lang_get().

Fixes 0027241
Affected Issues
0027241
mod - core/error_api.php Diff File

Issue History

Date Modified Username Field Change
2020-09-05 06:37 dregad New Issue
2020-09-05 06:37 dregad Status new => assigned
2020-09-05 06:37 dregad Assigned To => dregad
2020-09-05 06:55 dregad Note Added: 0064365
2020-09-25 19:36 dregad Changeset attached => MantisBT master 6ef1734d
2020-09-25 19:36 dregad Changeset attached => MantisBT master 60004349
2020-09-25 19:36 dregad Status assigned => resolved
2020-09-25 19:36 dregad Resolution open => fixed
2020-09-25 19:36 dregad Fixed in Version => 2.25.0