View Issue Details

IDProjectCategoryView StatusLast Update
0025493mantisbtbugtrackerpublic2019-02-19 16:33
ReporterChrisG Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0025493: Allow statuses with hyphens and spaces

Currently any status with a hyphen or space will fail as you map them to PHP variables, which don't support hyphens/spaces.

A filter function that replaces invalid characters with underscores would suffice, simple solution.

For a bug tracker to be user-friendly to novice users, having hyphens in statuses may be important.

TagsNo tags attached.




2019-02-19 16:16

developer   ~0061526

Using spaces should work by following the instructions in Admin Guide

where XXXX is the name of the new status as it was defined in g_status_enum_string above. If XXXX contains spaces, they should be replaced by underscores in the language strings names (e.g. for '35:pending user', use '$s_pending_user_bug_button')


2019-02-19 16:30

reporter   ~0061528

Last edited: 2019-02-19 16:33

View 3 revisions

Ah yes, apologies - spaces do work, hyphens do not. Mantis already does an '_' replace for spaces.

What I'm doing right now is changing the default code as follows:

$t_status_label = str_replace( ' ', '_', MantisEnum::getLabel( config_get( 'status_enum_string' ), $f_new_status ) );
$t_status_label = str_replace( array(' ', '-'), array('_', '_'), MantisEnum::getLabel( config_get( 'status_enum_string' ), $f_new_status ) );

But a better implementation would be something like preg_replace('#[^a-z\d_]#i', '_' ...

Issue History

Date Modified Username Field Change
2019-02-19 15:23 ChrisG New Issue
2019-02-19 16:16 atrol Note Added: 0061526
2019-02-19 16:30 ChrisG Note Added: 0061528
2019-02-19 16:31 ChrisG Note Edited: 0061528 View Revisions
2019-02-19 16:33 ChrisG Note Edited: 0061528 View Revisions