View Issue Details

IDProjectCategoryView StatusLast Update
0013643mantisbtadministrationpublic2014-09-23 18:05
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.9 
Target Version1.2.9Fixed in Version1.2.9 
Summary0013643: Definition of MANTIS_ERROR strings in plugin language file causes check in test_lang.php to fail
Description

A plugin which defines language strings for error messages in the following format

$MANTIS_ERROR['plugin_example_error1'] = 'error message';

Causes the check in admin/test_lang.php to fail with the following errors:

ERROR: ERROR: = sign without variable
ERROR: ERROR315T_CONSTANT_ENCAPSED_STRING'error message'44
ERROR: ERROR: duplicate language string ($MANTIS_ERROR ) (line 45)

Steps To Reproduce
  1. Install the current version of Csv_import plugin [1]
  2. Run the admin "Test Langs" check

[1] https://github.com/mantisbt-plugins/csv-import/tree/65650599aa901a77227e38bff0a64aaeba6ba92b

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

dregad

dregad

2011-12-02 09:11

developer   ~0030458

Patch for 1.2.x pushed; also applied to Master although the new format in strings_english.txt is not compatible with the current logic.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036332

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master af03f786

2011-12-01 23:23

dregad


Details Diff
Improve admin checks for language strings

This brings the following improvements to test_lang.php:

- Simplify the code by defining a new checkplugins() function for
plugins language checks, allowing to use a revised checklangdir()
for both the main and the plugin language strings (removes the
recursive call)

- Use PHP scandir() function to retrieve a sorted array of files
instead of manually building it using opendir() and a loop on
readdir()

- Process the languages in alphabetical order

- Array having strings as keys are valid tokens. Fixes 0013643
This avoids reporting errors is useful for plugin error strings like
$MANTIS_ERROR['plugin_example_error1'] = 'Error message';

- Better formatting of error messages

- Whitespace and coding guidelines fixes

NOTE: This commit has been ported to master for consistency, although
the new format of the strings_english.txt file is not compatible with
the logic in test_lang.php.
Affected Issues
0013643
mod - admin/test_langs.php Diff File

MantisBT: master-1.2.x 8e346687

2011-12-01 23:23

dregad


Details Diff
Improve admin checks for language strings

This brings the following improvements to test_lang.php:

- Simplify the code by defining a new checkplugins() function for
plugins language checks, allowing to use a revised checklangdir()
for both the main and the plugin language strings (removes the
recursive call)

- Use PHP scandir() function to retrieve a sorted array of files
instead of manually building it using opendir() and a loop on
readdir()

- Process the languages in alphabetical order

- Array having strings as keys are valid tokens. Fixes 0013643
This avoids reporting errors is useful for plugin error strings like
$MANTIS_ERROR['plugin_example_error1'] = 'Error message';

- Better formatting of error messages

- Whitespace and coding guidelines fixes
Affected Issues
0013643
mod - admin/test_langs.php Diff File