view all bug page - how to sort added custom fields

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Elmar

view all bug page - how to sort added custom fields

Post by Elmar »

He There!

I have an 0.19.1 instance running and we need to add a bug sort link to the header of an custom field column. How can I do this?

Example: I have a custom field called "Projektion" that has custom field id 1.
What I thought I would have to do is written behind the double slashes (obviously because it does not work ;-).

view_all_inc.php:
===============
<td> <?php
# -- Projection column --
echo lang_get( 'Projektion' );
//print_view_bug_sort_link( lang_get( 'Projektion' ), 'custom_field_1', $t_sort, $t_dir );
//print_sort_icon( $t_dir, $t_sort, 'Projektion' );
?>
</td>

In the view_all_set.php I discovered some code that should parse the custom field id but somehow it does not OR it does but still kicks off a wrong sql statement.

view_all_set.php:
===============
...
$t_custom_fields = custom_field_get_ids();
$f_custom_fields_data = array();
if ( is_array( $t_custom_fields ) && ( sizeof( $t_custom_fields ) > 0 ) ) {
foreach( $t_custom_fields as $t_cfid ) {
if ( is_array( gpc_get( 'custom_field_' . $t_cfid, null ) ) ) {
$f_custom_fields_data[$t_cfid] = gpc_get_string_array( 'custom_field_' . $t_cfid, 'any' );
} else {
$f_custom_fields_data[$t_cfid] = gpc_get_string( 'custom_field_' . $t_cfid, 'any' );
$f_custom_fields_data[$t_cfid] = array( $f_custom_fields_data[$t_cfid] );
}
}
}
...

Any suggestions are welcome. By the way, we can´t update to a newer version at the moment.

Best regards,
Elmar
Post Reply