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
Description

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.

Activities

atrol

atrol

2019-02-19 16:16

developer   ~0061526

Using spaces should work by following the instructions in Admin Guide https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.customize.status

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')
ChrisG

ChrisG

2019-02-19 16:30

reporter   ~0061528

Last edited: 2019-02-19 16:33

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 ) );
</code>
$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', '_' ...