Skip to content

Commit 25ad5c0

Browse files
committed
gpnf-override-parent-merge-tag-on-submission.php: Fixed an issue with parent merge tags not updating Time value on entry edit.
1 parent a793843 commit 25ad5c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gp-nested-forms/gpnf-override-parent-merge-tag-on-submission.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ function override_parent_merge_tags( $entry, $form ) {
9595
}
9696

9797
foreach ( $inputs as $input ) {
98-
$this->override_child_entry_input_value( $entry, $field, $child_form, $input['id'], rgar( $input, 'defaultValue' ) );
98+
$default_value = ( $child_field->type != 'time' )
99+
? rgar( $input, 'defaultValue' )
100+
: preg_replace('/(\d+)\.\d+/', '$1', rgar( $child_field['inputs'][0], 'defaultValue' ) );
101+
102+
$this->override_child_entry_input_value( $entry, $field, $child_form, $input['id'], $default_value );
99103
}
100104
}
101105
}

0 commit comments

Comments
 (0)