Commit 498628dc authored by KR Moorhouse's avatar KR Moorhouse

Updated save action to replace text-based fields with (redacted). Fixed issue...

Updated save action to replace text-based fields with (redacted). Fixed issue with multiselect lists in submission edit page.
parent cb189eae
......@@ -104,7 +104,20 @@ final class NF_Actions_Save extends NF_Abstracts_Action
// If we're supposed to save this field...
if( $save_field ) {
// Do so.
$sub->update_field_value( $field['id'], $field['value'] );
$sub->update_field_value( $field[ 'id' ], $field[ 'value' ] );
} // Otherwise...
else {
// If this field is not a list...
// AND If this field is not a checkbox...
// AND If this field is not a product...
// AND If this field is not a termslist...
if ( false == strpos( $field[ 'type' ], 'list' ) &&
false == strpos( $field[ 'type' ], 'checkbox' ) &&
'products' !== $field[ 'type' ] &&
'terms' !== $field[ 'type' ] ) {
// Anonymize it.
$sub->update_field_value( $field[ 'id' ], '(redacted)' );
}
}
}
......
......@@ -34,7 +34,7 @@ class NF_Fields_ListMultiselect extends NF_Abstracts_List
$options = '';
foreach( $field->get_setting( 'options' ) as $option ){
$selected = ( in_array( $option[ 'value' ], $value ) ) ? "selected" : '';
$selected = ( is_array( $value ) && in_array( $option[ 'value' ], $value ) ) ? "selected" : '';
$options .= "<option value='{$option[ 'value' ]}' $selected>{$option[ 'label' ]}</option>";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment