Skip to content

Commit

Permalink
fixed group field value save issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Codestar committed Jan 7, 2019
1 parent e031a6f commit a92d032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions fields/group/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public function render() {
$field['sub'] = true;
$field['class'] = ( ! empty( $field['class'] ) ) ? $field['class'] .' csf-no-script' : 'csf-no-script';

$unique = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
$value = ( ! empty( $field['id'] ) && ! empty( $value[$field['id']] ) ) ? $value[$field['id']] : '';
$unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
$field_value = ( isset( $field['id'] ) && isset( $value[$field['id']] ) ) ? $value[$field['id']] : '';

CSF::field( $field, $value, $unique, 'field/group' );
CSF::field( $field, $field_value, $unique_id, 'field/group' );

}

Expand Down
6 changes: 3 additions & 3 deletions fields/repeater/repeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public function render() {
if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }

$field['sub'] = true;
$unique = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
$value = ( isset( $field['id'] ) && isset( $this->value[$key][$field['id']] ) ) ? $this->value[$key][$field['id']] : '';
$unique = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
$field_value = ( isset( $field['id'] ) && isset( $this->value[$key][$field['id']] ) ) ? $this->value[$key][$field['id']] : '';

CSF::field( $field, $value, $unique, 'field/repeater' );
CSF::field( $field, $field_value, $unique, 'field/repeater' );

}
echo '</div>';
Expand Down

0 comments on commit a92d032

Please sign in to comment.