• Hi all,

    We noticed that on Map Form page there are some Custom Fields which are deleted from InfusionSoft, even after feed refresh. After investigation, we found that these custom fields have FormId value set to -1000 or 0 (zero), which means ‘Field is deleted from DataFormField table’. Info here http://community.infusionsoft.com/showthread.php/17441-What-FormId-1000-stands-for-at-DataFormField-table.

    To prevent displaying these fields which could not be populated with content from GravityForms because they don’t exists anymore in InfusionSoft, we added one line of code to infusionsoft.php core plugin file.

    In version 1.5.11 to method get_fields() (line 1373) we add:

    // Do not display deleted fields (FormId=-1000)
                        if ( in_array( $v->__get('FormId'), array( '-1000', '0' ) ) ) { continue; }

    So listing of custom fields from this:

    if(!empty($custom_fields)) {
                foreach($custom_fields as $key => $field) {
    
                    if(!is_array($field)) { continue; }
    
                    foreach($field as $k => $v) {
    
                        if(!is_a($v, 'Infusionsoft_DataFormField')) { continue; }
    
                        $lists[] = array(
                            'name' => esc_js($v->__get('Label')),
                            'req' => false,
                            'tag' => esc_js($v->__get('Name')),
                        );
                    }
                }
            }

    become this:

    if(!empty($custom_fields)) {
                foreach($custom_fields as $key => $field) {
    
                    if(!is_array($field)) { continue; }
    
                    foreach($field as $k => $v) {
    
                        if(!is_a($v, 'Infusionsoft_DataFormField')) { continue; }
    
                        // Do not display deleted fields (FormId=-1000)
                        if ( in_array( $v->__get('FormId'), array( '-1000', '0' ) ) ) { continue; }
    
                        $lists[] = array(
                            'name' => esc_js($v->__get('Label')),
                            'req' => false,
                            'tag' => esc_js($v->__get('Name')),
                        );
                    }
                }
            }

    Can you please include this fix, or maybe better before setting site transient for custom fields you can remove deleted fields from feed, so avoid filtering on each Map Form display.

    Cheers,
    Aleksandar

    https://wordpress.org/plugins/infusionsoft/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hide deleted Custom Fields from Map Form’ is closed to new replies.