View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0021887 | mantisbt | plug-ins | public | 2016-11-08 14:58 | 2017-04-04 12:11 |
Reporter | mcmo | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | new | Resolution | open | ||
Summary | 0021887: Dynamic values for Enumeration Custom Fields using a Plugin | ||||
Description | In MantisBT 2.0.0, the Custom Functions are deprecated in favor of Plugins. In this case, how to create a dynamic list for an enumeration custom field using a plugin? | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
We haven't disabled custom functions yet, but this is a good feature request for plugin-ins support for the scenario. |
|
Is it currently possible to create a custom function using a plug-in, i.e. having a custom_functions_inc.php file per plugin? |
|
I'm currently working on a plugin that dynamically give the values of enumeration custom fields in function of the current project. As for now I use the custom function to redirect it to my plugin but as you said it's deprecated. But I found where in the core code that is calling the custom function for custom field and I modified it in a way that don't break actual fonctionnement but call my plugin function if it's installed. the actual code is : ( in custom_field_api.php)
And I modified it to be :
Once I finalized my plugin I can push it to git if you want and with the modification in the core code you can answer to the need of dynamic custom field without custom function. Do you think you can integrate this plugin to the mantis core in the futur ? ps: I'm currently developing in the 1.3.5 version of mantis but I can adapt it to the 2.0 if there a need to. |
|
Hi, I finalized my plugin so I leave it in attachement. Note that this plugin work only if you do the modification is core/custom_field_api.php you have to replace :
by :
A READ_ME.txt in the .zip indicate how to use the plugin. if you qualify this plugin suitable @vboctor I can do a PR for the core function and I can also create a git repository for code review. |
|
Hi A quick check in the code seems to indicate the change should be in core.php
that code should be extended to scan the subfolders of all plugins to include the custom functions files. |
|