Skip to content

Commit b3add99

Browse files
committed
Fixed issue where this would cause GPEB editor views to show incorrect values
1 parent 8bad635 commit b3add99

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

gravity-forms/gw-save-and-continue-auto-load.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public function handle_token_storage( $form, $page_number ) {
6868
return;
6969
}
7070

71+
if ( ! $this->is_applicable_form( $form['id'] ) ) {
72+
return;
73+
}
74+
7175
$submission = GFFormDisplay::$submission[ $form['id'] ];
7276
$is_successful_submission = $page_number == 0 && $submission['is_valid'];
7377

@@ -139,10 +143,24 @@ public function get_confirmation_message( $form ) {
139143
return $message;
140144
}
141145

142-
public function is_applicable_form( $form ) {
143146

147+
public function is_editing_entry( $form_id ) {
148+
if ( ! method_exists( 'GP_Entry_Blocks\GF_Queryer', 'attach_to_current_block' ) ) {
149+
return false;
150+
}
151+
152+
$entry_block = GP_Entry_Blocks\GF_Queryer::attach_to_current_block();
153+
154+
return $entry_block && $entry_block->is_edit_entry() && $entry_block->form_id === $form_id;
155+
}
156+
157+
public function is_applicable_form( $form ) {
144158
$form_id = isset( $form['id'] ) ? $form['id'] : $form;
145159

160+
if ( $this->is_editing_entry( $form_id ) ) {
161+
return false;
162+
}
163+
146164
return empty( $this->_args['form_ids'] ) || in_array( $form_id, $this->_args['form_ids'] );
147165
}
148166

0 commit comments

Comments
 (0)