From 5c55a2644ebbba8e41f3ba03f4f948057ee14db6 Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Wed, 8 Jan 2025 14:39:31 +0530 Subject: [PATCH 1/2] `gppa-gpeb-force-rehydration-on-edit.php`: Fixed issue with rehydration not working on GPEB entry. --- gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php b/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php index f748673c4..8127515fc 100644 --- a/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php +++ b/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php @@ -16,14 +16,14 @@ // Update (or remove) "4", "5", and "6" to the field IDs that should be rehydrated. $field_ids = array( 4, 5, 6 ); - if ( ! is_callable( array( 'GP_Populate_Anything', 'populate_field' ) ) || ! isset( $GLOBALS['gppa-field-values'] ) || $entry['form_id'] != $form_id ) { + if ( ! is_callable( array( gp_populate_anything(), 'populate_field' ) ) || ! isset( $GLOBALS['gppa-field-values'] ) || $entry['form_id'] != $form_id ) { return $entry; } $form = GFAPI::get_form( $form_id ); foreach ( $form['fields'] as &$field ) { if ( in_array( $field->id, $field_ids ) ) { - $hydrated_field = gp_populate_anything()->populate_field( $field, $form, array(), $entry ); + $hydrated_field = gp_populate_anything()->populate_field( $field, $form, array(), gp_populate_anything()->get_posted_field_values( $form ) ); $entry[ $field->id ] = $hydrated_field['field_value']; } } From 9cc34969f69c721a75c272c92a3afab324abf273 Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Wed, 8 Jan 2025 14:42:36 +0530 Subject: [PATCH 2/2] `gppa-gpeb-force-rehydration-on-edit.php`: Fixed issue with rehydration not working on GPEB entry. --- gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php b/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php index 8127515fc..4b5f43912 100644 --- a/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php +++ b/gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php @@ -23,7 +23,7 @@ $form = GFAPI::get_form( $form_id ); foreach ( $form['fields'] as &$field ) { if ( in_array( $field->id, $field_ids ) ) { - $hydrated_field = gp_populate_anything()->populate_field( $field, $form, array(), gp_populate_anything()->get_posted_field_values( $form ) ); + $hydrated_field = gp_populate_anything()->populate_field( $field, $form, gp_populate_anything()->get_posted_field_values( $form ), array() ); $entry[ $field->id ] = $hydrated_field['field_value']; } }