Sort by can't handle more than one custom field in combinan
Posted: 12 Sep 2012, 11:32
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!
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!