Skip to content

Commit 3ad0e60

Browse files
committed
fix: check if $source['id'] is empty before resolving connectedFormFields.
1 parent b457ce6 commit 3ad0e60

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- fix: Check if classes are loaded by a different autoloader before attempting to autoload them. H/t @cvanh
66
- fix: Return `wp_max_upload_size()` instead of `null` if `GfFieldWithFileSizeSetting.maxFileSize` is `null`. H/t @Gytjarek
77
- fix: Fix typo in Autoloader release URL.
8+
- fix: Ensure a valid source ID exists before attempting to resolve a `connectedFormField`.
89
- ci: Replace calls to `docker-compose` with `docker compose`.
910

1011
## v0.13.0

src/Type/WPObject/FieldError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function get_fields(): array {
5151
'type' => FormField::$type,
5252
'description' => __( 'The form field that the error is connected to.', 'wp-graphql-gravity-forms' ),
5353
'resolve' => static function ( $source, array $args, AppContext $context ) {
54-
if ( ! isset( $source['id'] ) || ! isset( $source['formId'] ) ) {
54+
if ( empty( $source['id'] ) || empty( $source['formId'] ) ) {
5555
return null;
5656
}
5757

src/Type/WPObject/Order/OrderItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function get_fields(): array {
109109
'type' => FormField::$type,
110110
'description' => __( 'The form field that the order item is connected to', 'wp-graphql-gravity-forms' ),
111111
'resolve' => static function ( $source, array $args, AppContext $context ) {
112-
if ( ! isset( $context->gfForm ) || ! isset( $source['id'] ) ) {
112+
if ( ! isset( $context->gfForm ) || empty( $source['id'] ) ) {
113113
return null;
114114
}
115115

0 commit comments

Comments
 (0)