currently I am doing have cutomizations by developing plugins for Mantis. During that work the following problem occured:
I have a custom mantis column created according to many plugins that I found on git.mantisforge.org
Code: Select all
class EstimationSumColumn extends MantisColumn
{
public $title = "Estimation Sum";
public $column = "custom_estimation_sum";
public function display( $p_bug, $p_columns_target )
{
/* ... */
}
}
Code: Select all
function hooks( )
{
/* ... */
EVENT_FILTER_COLUMNS' => 'event_filter_columns',
/* ... */
}
Code: Select all
function event_filter_columns()
{
require_once( 'EstimationSumColumn.class.php' );
return array(
'EstimationSumColumn',
);
}
Therefore I defined the following function:Fatal error: Call to undefined function csv_format_timetracking_estimation_sum() in csv_export.php on line 116
Code: Select all
function csv_format_estimation_sum( $p_description ) {
return csv_escape_string( $p_description );
}
So I investigated the core file csv_export.php. The following section shows the part where the FATAL error came from:
Code: Select all
095: # export the rows
096: foreach ( $t_rows as $t_row ) {
097: $t_first_column = true;
098:
099: foreach ( $t_columns as $t_column ) {
100: if ( !$t_first_column ) {
101: echo $t_sep;
102: } else {
103: $t_first_column = false;
104: }
105:
106: $t_custom_field = column_get_custom_field_name( $t_column );
107: if ( $t_custom_field !== null ) {
108: ob_start();
109: $t_column_value_function = 'print_column_value';
110: helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row, COLUMNS_TARGET_CSV_PAGE ) );
111: $t_value = ob_get_clean();
112:
113: echo csv_escape_string($t_value);
114: } else {
115: $t_function = 'csv_format_' . $t_column;
116: echo $t_function( $t_row->$t_column );
117: }
118: }
119:
120: echo $t_nl;
121: }
1. I missed something so that the core gets the data in to the $t_row->$t_column and can export it.
But I found nothing in plugins I search on git.mantisforge that would help me. Even worse: All plugins that inherit a custom column as I did have the same problem, that the CSV and Excel export does not work...
or
2.The Mantis Core has a bug. If this is true, then I will further investigate and post an according message into the bugtracker of Mantis and probably also a solution. But before I further investigate I wanted to ask the Forum members, whether I simply missed something that I should have done to get it work...
Any help or comments are welcome