Viewing 1 replies (of 1 total)
  • Thread Starter gravitylover

    (@gravitylover)

    Fixed, some modifications needed in gravity-forms-addons.php

    Approach 1, wildcard fields:

    line 2819:

    $fuzzy_field = "$field_id.%";
    $in_search_criteria .= $wpdb->prepare( " AND l.id IN (SELECT lead_id from $detail_table_name WHERE (field_number = %s OR field_number LIKE %s) AND value LIKE %s)", $field_id, $fuzzy_field, $value );

    line 2847:

    $fuzzy_field = "$field_id.%";
    $in_search_criteria .= $wpdb->prepare( " AND l.id IN (SELECT lead_id from $lead_detail_table_name WHERE (field_number = %s OR field_number LIKE %s) AND value LIKE %s)", $field_id,  $fuzzy_field, $value );

    Approach 2: GF style (as seen in forms_model.php)

    line 2819:

    $upper_field_number_limit = (string) (int) $field_id === (string) $field_id ? (float) $field_id + 0.9999 : (float) $field_id + 0.0001;
    $in_search_criteria .= $wpdb->prepare( " AND l.id IN (SELECT lead_id from $detail_table_name WHERE field_number BETWEEN %s AND %s AND value LIKE %s)", (float) $field_id - 0.0001, $upper_field_number_limit, $value );

    line 2847:

    $upper_field_number_limit = (string) (int) $field_id === (string) $field_id ? (float) $field_id + 0.9999 : (float) $field_id + 0.0001;
    $in_search_criteria .= $wpdb->prepare( " AND l.id IN (SELECT lead_id from $lead_detail_table_name WHERE field_number BETWEEN %s AND %s AND value LIKE %s)", (float) $field_id - 0.0001, $upper_field_number_limit, $value );

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot filter by checkbox fields’ is closed to new replies.