When adding different input to list field its not possible to add new row with new version

Hi, i have a list field on my form.
i use a filter to change the input type on some of the fields on the list.
like this:

add_filter( 'gform_column_input_52_63_7', 'add_yes_no_select_list', 10, 5 );
function add_yes_no_select_list( $input_info, $field, $column, $value, $form_id ) {
    return array( 'type' => 'select', 'choices' => 'Yes,No' );
}

this works ok, but now since the new version update, i cannot use the add_list_item click to duplicate the row and add a new empty row to the list. (the plus sign at the end of the row)
when clicking it, it now throws a js error:

“Error: Uncaught TypeError: Cannot read properties of undefined (reading ‘format’) URL: https://www.telemessage.com/wp-content/plugins/gravityforms/js/gravityforms.min.js?ver=2.6.3 Line Number: 1”

any way to get pass this ?

Thanks

I can’t replicate the issue using the same code snippet in a default WordPress installation. I would recommend you to perform a full conflict test: Testing for a Theme/Plugin Conflict using the Health Check & Troubleshooting Plugin - Gravity Forms Documentation

before i run this conflict test (its a complicated procedure, my site is live and has many plugins running)
can you tell me what this js error might be referring to ? how can i locate the element causing the issue here:

Error: Uncaught TypeError: Cannot read properties of undefined (reading ‘format’) URL: https://www.telemessage.com/wp-content/plugins/gravityforms/js/gravityforms.min.js?ver=2.6.3 Line Number: 1

Ok, i solved it.
the error was coming from this function in gravityforms.min.js

function gformAdjustRowAttributes(e) {
    e.parents(".gform_wrapper").hasClass("gform_legacy_markup_wrapper") ||
        e.find(".gfield_list_group").each(function (r) {
            jQuery(this)
                .find("input, select, textarea")
                .each(function (e, t) {
                    t = jQuery(t);
                    t.attr("aria-label", t.data("aria-label-template").format(r + 1));
                });
            var e = jQuery(this).find(".delete_list_item");
            e.attr("aria-label", e.data("aria-label-template").format(r + 1));
        });
}

if i was passing another filter with this code

add_filter( 'gform_column_input_content_52_63_7', 'mobile_archiver_service_order_en_checkbox_field', 10, 5 );
function mobile_archiver_service_order_en_checkbox_field( $input_info, $field, $column, $value, $form_id ) {
	$new_input = '<div  class="gfield_checkbox cb_list_products"><div class="gchoice_52_63_7_0"> 
						<input class="gfield-choice-input" name="input_[]" type="checkbox" value="Yes"  '. GFCommon::get_tabindex() .' >
						<label for="choice_52_63_7_1" >Yes/No</label>
					  </div></div>';
	 return $new_input;
}

The attributes aria-label=“en” and data-aria-label-template="" were missing from the input field.
adding them like this fixed it
<input class="gfield-choice-input" name="input_[]" type="checkbox" value="Yes" '. GFCommon::get_tabindex() .' aria-label="en" data-aria-label-template="">

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.