RWListFieldCalculations icon indicating copy to clipboard operation
RWListFieldCalculations copied to clipboard

Value is not saved in Gravity Forms with Drop Down List Field for Gravity Forms

Open sidouglas opened this issue 6 years ago • 0 comments

Form setup

Details of bug

  • In conjunction with the Drop Down List Field for Gravity Forms

http://youtu.be/UfiFfd-fkMY ( very short video ).

When setting a label and value in the Drop Down List Field for Gravity Forms plugin (https://wordpress.org/plugins/gravity-forms-list-field-select-drop-down/) The calculated value is not saved.

Setup to reproduce:

Using Gravity Forms List Field Calculations Add-On

N|Solid

Total field ( which is a number field ) using "List (Column Sum)"

N|Solid

Work around which has fixed my issue

RWListFieldCalculations.php: var_dump($value) on line 147:
array (size=1)
  'Items' => string '7' (length=1)

Should be:

foreach ( $list_values as $value ) {
  if ( $column_count == 1 ) {
    $value = is_array($value) ? current($value) : $value; //$value could be an array
    $count += GFCommon::to_number( $value ); // otherwise this expression is false
  } else {
    $count += GFCommon::to_number( $value[ $column ] );
  }
}

sidouglas avatar Jan 04 '19 03:01 sidouglas