Context
I'm using a custom Filter to render a repeater field as formatted HTML in a "summary" step of a multi-step form.
Bug
After updating to version 3.6.0, the following code throws:
TypeError: observableRow.getInputs is not a function
Reproduction
<script>
jQuery( () => {
const { addFilter } = JetPlugins.hooks;
const { Filter } = JetFormBuilderAbstract;
function RepeaterFilter() {
Filter.call( this );
this.getSlug = function () {
return 'repeaterTemplate';
};
this.apply = function ( value ) {
const output = [];
for ( const observableRow of value ) {
// ❌ Throws: observableRow.getInputs is not a function
for ( const input of observableRow.getInputs() ) {
output.push( `${ input.name }: ${ input.getValue() }` );
}
}
return output.join( ', ' );
};
}
RepeaterFilter.prototype = Object.create( Filter.prototype );
addFilter(
'jet.fb.filters',
'minimal-repeater-filter',
function ( filters ) {
filters.push( RepeaterFilter );
return filters;
},
);
} );
</script>
<!-- Usage in an HTML block -->
<!JFB_FIELD::my_repeater|repeaterTemplate>
Expected
getInputs() returns the inputs of the repeater row, as in previous versions.
Actual
Couldn't test on latest yet, rolled back to 3.5.6.3
Questions
- Is this an intentional API change?
- What is the new recommended way to iterate inputs of a repeater row from a custom Filter?
- Could this be documented in the migration notes?
Environment
- JFB version: 3.6.0 and upward (broken) / 3.5.6.3 (working)
- WP version: 6.9
- Browser: Safari 18.4
Context
I'm using a custom
Filterto render a repeater field as formatted HTML in a "summary" step of a multi-step form.Bug
After updating to version 3.6.0, the following code throws:
Reproduction
Expected
getInputs()returns the inputs of the repeater row, as in previous versions.Actual
Couldn't test on latest yet, rolled back to 3.5.6.3
Questions
Environment