Sort by can't handle more than one custom field in combinan

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
shanthini
Posts: 25
Joined: Apr 10, 2010 7:01 am

Sort by can't handle more than one custom field in combinan

Post by shanthini » Sep 12, 2012 6:32 am

Hi

We are using Mantis 1.2.0 and we got the same error as in the link http://www.mantisbt.org/bugs/view.php?id=5859. To resolve this we deleted MANTIS_VIEW_ALL_COOKIE cookie and the error gone away.

In the same link http://www.mantisbt.org/bugs/view.php?id=5859 another solution is given. That is to change the code in core\filter_api.php. But when we looked in to core\filter_api.php file we could not able to find the code. Only first part of the code we could able to see as below. Please advice.

# if sorting by a custom field
if( strpos( $c_sort, 'custom_' ) === 0 ) {
$t_custom_field = utf8_substr( $c_sort, utf8_strlen( 'custom_' ) );
$t_custom_field_id = custom_field_get_id_from_name( $t_custom_field );

$c_cf_alias = str_replace( ' ', '_', $t_custom_field );
$t_cf_table_alias = $t_custom_field_string_table . '_' . $t_custom_field_id;
$t_cf_select = "$t_cf_table_alias.value $c_cf_alias";

Also we understand that in latest versions this issue is resolved. But we do not want to do the upgrade. Please advice where to change the code in Mantis version 1.2.0 to solve this issue.

Thanks in advance!

Lapinkiller
Posts: 408
Joined: Jan 28, 2011 1:47 pm
Location: France
Contact:

Re: Sort by can't handle more than one custom field in combi

Post by Lapinkiller » Sep 14, 2012 7:30 am

hello

Why you can change code but not upgrade ?
Lapinkiller,
French PHP developer
New look for your mantis : http://www.mantisbt.org/forums/viewtopi ... =4&t=20055

shanthini
Posts: 25
Joined: Apr 10, 2010 7:01 am

Re: Sort by can't handle more than one custom field in combi

Post by shanthini » Sep 16, 2012 11:33 pm

Hi,

Actually we are using Mantis version 1.2.0 for the past 2 years. In that some customizations we did as per our requirement. If we go for an upgrade we may loose all our customization work.

So in the existing source it self we want to correct the error. So could you please guide in which file we need to include the correction and how to change the code.

Thanks

Post Reply