From 14f7b50a4cfdbdbf3ac77e477ee98c285362b9f5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 26 Nov 2024 15:40:26 -0500 Subject: [PATCH] Process merge tags in redirect URLs inside the lightbox (#2220) --- .../class-gravityview-lightbox-entry.php | 21 ++++++++++++++----- readme.txt | 3 +++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php b/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php index 03767f9b1..dfcceebb4 100644 --- a/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php +++ b/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php @@ -127,7 +127,7 @@ public function process_rest_request( $request ) { gravityview()->request = new GravityView_Lightbox_Entry_Request( $view, $entry ); if ( $delete_nonce ) { - return $this->process_delete_entry( $view ); + return $this->process_delete_entry( $view, $entry, $form ); } if ( $duplicate_nonce ) { @@ -339,7 +339,11 @@ private function process_edit_entry( $nonce, $view, $entry, $form ) { } $reload_page = 1 === (int) $view->settings->get( 'edit_redirect' ) ? 'true' : 'false'; - $redirect_to_url = 2 === (int) $view->settings->get( 'edit_redirect' ) ? esc_url( $view->settings->get( 'edit_redirect_url', '' ) ) : ''; + $redirect_to_url = 2 === (int) $view->settings->get( 'edit_redirect' ) ? $view->settings->get( 'edit_redirect_url', '' ) : ''; + + if ( $redirect_to_url ) { + $redirect_to_url = esc_url( GravityView_API::replace_variables( $redirect_to_url, $form, $entry->as_entry() ) ); + } add_filter( 'gravityview/edit_entry/success', function ( $message ) use ( $view, $reload_page, $redirect_to_url ) { return <<settings->get( 'delete_redirect' ) ? 'true' : 'false'; $redirect_to_url = GravityView_Delete_Entry::REDIRECT_TO_URL_VALUE === (int) $view->settings->get( 'delete_redirect' ) ? esc_url( $view->settings->get( 'delete_redirect_url', '' ) ) : ''; + if ( $redirect_to_url ) { + $redirect_to_url = esc_url( GravityView_API::replace_variables( $redirect_to_url, $form, $entry->as_entry() ) ); + } + ob_start(); echo <<settings->get( 'single_title', '' ), $form, - $entry + $entry->as_entry() ) ); diff --git a/readme.txt b/readme.txt index e8a4d7fa0..88b963aeb 100644 --- a/readme.txt +++ b/readme.txt @@ -23,6 +23,9 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h = develop = +#### 🐛 Fixed +* Merge tags in redirect URLs were not processed after editing or deleting an entry in the lightbox. + = 2.32 on November 21, 2024 = This release adds a new form notification option for updated entries, resolves file upload issues on the Edit Entry screen, and includes developer-focused enhancements.