Manage Columns Name

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

Post Reply
ppatel
Posts: 8
Joined: 12 May 2022, 16:22

Manage Columns Name

Post by ppatel »

Hello,

I recently created a plugin to create a column called "date_closed".
Code is here: https://github.com/priyam759/MantisBT-P ... /tree/main

When going into manage columns, I want the field name there to look like "date_closed" just like "date_submitted" is. However, an "_" is being added automatically to the end of the field name there. (See attached).

There is nothing in MantisColumn class or MantisPlugin class to change this, and when I checked core/plugin_api.php I saw some code that I believe is the reason this is occurring (see function below)
function plugin_config_get( $p_option, $p_default = null, $p_global = false, $p_user = null, $p_project = null ) {
$t_basename = plugin_get_current();
$t_full_option = 'plugin_' . $t_basename . '_' . $p_option;

if( $p_global ) {
return config_get_global( $t_full_option, $p_default );
} else {
return config_get( $t_full_option, $p_default, $p_user, $p_project );
}
}

Is there any way to override this or another function that is responsible for the "_" being added automatically in Manage Columns in my plugin?

Thank you
Attachments
ManageConfiguration.PNG
ManageConfiguration.PNG (23.86 KiB) Viewed 12599 times
cas
Posts: 1635
Joined: 11 Mar 2006, 16:08
Contact:

Re: Manage Columns Name

Post by cas »

You are looking @ the config of the plugin.
For what you are doing, check out function columns_get_plugin_columns(), this one you can find in core/columns_api :mrgreen:
ppatel
Posts: 8
Joined: 12 May 2022, 16:22

Re: Manage Columns Name

Post by ppatel »

Thank you for that info.

Am I able to call that function in my plugin and override it to remove adding the "_"? Or would I have to override the function outside of the plugin (affects whole website)?
cas
Posts: 1635
Joined: 11 Mar 2006, 16:08
Contact:

Re: Manage Columns Name

Post by cas »

I did not really check the function so you need to dig a bit
Post Reply