Skip to content

Commit 5ede068

Browse files
committed
Bug fix to prevent file not exists warnings
1 parent 55c6163 commit 5ede068

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

includes/class-gfpb-local-json.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ public static function save_form_export( $form, $is_new = false ) {
140140
$json = apply_filters( 'gravityforms_local_json_minimize', false ) ? wp_json_encode( $forms ) : wp_json_encode( $forms, JSON_PRETTY_PRINT );
141141

142142
// Would the file be different?
143-
$saved_json = file_get_contents( $save_path );
144-
if ( $json === $saved_json ) {
143+
if ( file_exists( $save_path ) && file_get_contents( $save_path ) === $json ) {
145144
// No. Do not update it, preserve the file date.
146145
return;
147146
}

0 commit comments

Comments
 (0)