Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,10 @@ public static function switch_field_ids( $val ) {

foreach ( $val as $k => $v ) {
if ( ! is_string( $v ) ) {
if ( is_array( $v ) ) {
$val[ $k ] = self::switch_field_ids( $v );
unset( $k, $v );
}
continue;
}

Expand All @@ -1835,9 +1839,15 @@ public static function switch_field_ids( $val ) {
continue;
}

if ( isset( $frm_duplicate_ids[ $v ] ) ) {
$val[ $k ] = $frm_duplicate_ids[ $v ];
unset( $k, $v );
continue;
}

$val[ $k ] = str_replace( $replace, $replace_with, $v );
unset( $k, $v );
}
}//end foreach

return $val;
}
Expand Down
2 changes: 2 additions & 0 deletions classes/models/FrmFormAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ public function duplicate_one( $action, $form_id ) {
foreach ( $switch[ $key ] as $subkey ) {
$action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val );
}
} elseif ( is_array( $val ) ) {
$action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val );
}

unset( $key, $val );
Expand Down
Loading