Problem with dropdown filter plugn

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
krisbass
Posts: 1
Joined: 06 Sep 2016, 14:24

Problem with dropdown filter plugn

Post by krisbass »

Hello all,
I'm creating a filter plugin for Mantis BT 1.2.19. My problem is that I need a dropdown list but this is populate only by 'ANY' and I cannot understand how I can read the variables I added in the config_inc.php.

The filter is called FilterGroupList and the FilterGroupList.php placed in the FilterGroupList folder in Plugin.
In config_inc.php I added the string g_filtergrouplist_enum_string in the following way:

$g_filtergrouplist_enum_string= '0:not selected, 10:select1, 20:select2, 30:select3;

In the costant_inc.php I added the following instruction:
define ( 'NOT_SELECTED', 0 );
define ( 'SELECT1', 10 );
define ( 'SELECT2', 20 );
define ( 'SELECT3', 30 );

Otherwise I added in the config_filter_defaults_inc.php the following instructions:
define( 'FILTER_PROPERTY_TEAM', 'FilterGroupList' );
define( 'FILTER_SEARCH_TEAM', 'FilterGroupList');

I created the folder Config and the file custom_strings_inc.php that contains the following instruction:
$s_filtergrouplist = STRING;

The filter appear in the ViewIssue page but when I select it the dropdown is filled just only by ANY.
I checked that into the return_dynamic_filter.php file when the function return_dynamic_filters_prepend_headers is trying to check if the function exists (searched as print_filter_FilterGroupList_list) enter in the else condition, for plugin, and when enter inside the loop:
foreach ( $t_plugin_filters as $t_field_name => $t_filter_object ) the $t_filter_object is empty.

Can someone help me to understand where I mistake the configuration?

Thanks in advance
Cristiano
Post Reply