Hi!
Not sure if this is the same problem and there are quite similar topics.
My page broke when it had two forms on the page.
One form is using a column break field and another one is without it.
Using version 4.0.0
PHP Warning: Undefined array key 1 in gf-form-multicolumn/includes/public/WH_GF_Multicolumn_Public_Form_Current.php on line 145
PHP Warning: Undefined array key 1 ingf-form-multicolumn/includes/public/WH_GF_Multicolumn_Public_Form_Current.php on line 147
PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in gf-form-multicolumn/includes/public/WH_GF_Multicolumn_Public_Form_Current.php:147
So i was checking the code and the problem was with.
$columnWidthCount = $this->rowColumnArray[ $this->rowCounter ] * 2;
$columnWidth = is_numeric( ( 100 - $columnWidthCount ) /
$this->rowColumnArray[ $this->rowCounter ] )
? floor( ( 100 - $columnWidthCount ) /
$this->rowColumnArray[ $this->rowCounter ] ) : 1;
This solution fixed the problem for me.
public function define_output_elements_2_5( $field_container, $field, $form ) {
if ( $this->is_gfmc_field_type( $field->type ) ) {
$columnWidthCount = isset( $this->rowColumnArray[ $this->rowCounter ] ) && $this->rowColumnArray[ $this->rowCounter ] > 0 ?
$this->rowColumnArray[ $this->rowCounter ] * 2 : 1;
$columnWidth = is_numeric( ( 100 - $columnWidthCount ) / $columnWidthCount )
? floor( ( 100 - $columnWidthCount ) / $columnWidthCount ) : 1;