I am currently validating the upgrade of our MantisBT server from the version 2.1 to 2.26.1.
Years ago I created a plugin to add some hints to some fields when entering a ticket.
It worked correctly so far. In v2.26.1, it works. At least, I haven't seen yet any issue.
But when I run the admin/test_langs.php#plugins there are errors:
Code: Select all
ERRORS
Line 9: Unexpected T_ARRAY token 'array'
Line 9: Unknown token '('
Line 10: Unexpected T_DOUBLE_ARROW token '=>'
Line 10: Unexpected T_DOUBLE_ARROW token '=>'
Line 10: Unexpected T_CONSTANT_ENCAPSED_STRING token ''Test cell/Cluster Server/Office workstation where the issue occurred''
Line 10: Unknown token ','
Line 11: Unexpected T_CONSTANT_ENCAPSED_STRING token ''Reseller\'s Issue Reference''here are the contents of the file:
Code: Select all
<?php
# Copyright (c) 2017 HORIBA Test Automation Ltd.
$s_plugin_FieldHints_ = '';
$s_plugin_FieldHints_title = 'Field Hints';
$s_plugin_FieldHints_description = 'Plugin to add hints below the fields names';
# Hints for fields when editing
$s_plugin_FieldHints_field_hints_enum_string_REPORT=array(
'Test Cell Name' => 'Test cell/Cluster Server/Office workstation where the issue occurred' ,
'Reseller\'s Issue Reference' => 'Enter here the Issue ticket ID in your tracking system' ,
'Issue Group Reference' => 'The text in this field may be used in conjunction with customer fields to create an Open Issue List',
'Application Suites' => 'Hold CTRL to select multiple options',
'CR/Backlog Items/Work Items and Status' => 'List of StarTeam CRs, Rhythm Backlog Items or Stories, or Azure DevOps Work Items created from this ticket and their corresponding Statuses',
'Solution / Workaround' => 'Describe here the workaround and/or the solution',
'Relevant Knowledgebase Article(s)' => 'code and title of the article that helped solving the issue.\nIf needed and not existing, type "to be created"',
'Next Action' => 'Describe here the next action to solve the issue',
'Upload Files' => 'If a file is too big to be uploaded onto this server, please use the HTA FTP server.');
$s_plugin_FieldHints_field_hints_enum_string_EDIT = array (
'Solution / Workaround' => 'Including patch location and relevant knowledge base articles',
);
# Hints for fields when viewing
$s_plugin_FieldHints_field_hints_enum_string_VIEW = array (
'Note' => 'If you want to upload a file, the note must be public.<br>Uploaded data are visible to all allowed users.<br>There is no private attachment.',
'Upload Files' => 'If a file is too big to be uploaded onto this server, please use the HTA FTP server.',
);But this does not seem to please test_langs.php.
I think the "errors" are detected in the checkTokens function https://github.com/mantisbt/mantisbt/bl ... s.php#L259
Hence a few questions:
- Are those errors really important?
- Why is valid PHP code considered as faulty?
- What is the correct syntax for the MantisBT language files?
Marc