diff --git a/changelog.txt b/changelog.txt index ef16753597..55673cc87a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ == Changelog == += 6.17.1 = +* Fix: The payments table admin page would appear empty when there were unread inbox notices. + = 6.17 = * New: New redirect delay duration and delay message settings have been added to confirmation actions. * New: A new UTF-8 with BOM format option has been added when exporting entries as CSV. diff --git a/readme.txt b/readme.txt index 85adc7ef9c..dbb74db208 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: forms, form builder, survey, payment form, custom form, contact form, form Requires at least: 5.2 Tested up to: 6.7.1 Requires PHP: 7.0 -Stable tag: 6.17 +Stable tag: 6.17.1 The most advanced WordPress forms plugin. Go beyond contact forms with our drag and drop form builder for surveys, quizzes, and more. @@ -371,6 +371,9 @@ Using our Zapier integration, you can easily connect your website with over 5,00 See all [Formidable Zapier Integrations](https://zapier.com/apps/formidable/integrations). == Changelog == += 6.17.1 = +* Fix: The payments table admin page would appear empty when there were unread inbox notices. + = 6.17 = * New: New redirect delay duration and delay message settings have been added to confirmation actions. * New: A new UTF-8 with BOM format option has been added when exporting entries as CSV. @@ -403,21 +406,6 @@ See all [Formidable Zapier Integrations](https://zapier.com/apps/formidable/inte * Security: Additional context checks and filtering have been added to prevent posted script data from appearing inside of fields. * Fix: JSON default values are no longer decoded for field types that expect string values only. -= 6.16.1 = -* New: Database queries for entry ID data have been optimized, removing a JOIN in cases where it is not required. This should significantly improve performance when searching for entries in a View. -* Fix: Collapsible sections in the styler settings would no longer open after the recent WordPress 6.7 update. -* Fix: The label position setting and CSS layout classes for summary fields were not working. Since None is also the default value for Summary field label positions, this means that Summary field labels that previously were visible likely are no longer visible. -* Fix: The slider to set field margin for section fields wouldn't properly save. -* Fix: Checkbox selection would not work on iPhones when using frm_grid classes. -* Fix: An automatic conversion of false to array deprecated message that would occur when loading the visual styler with the Authorize.Net add-on active has been fixed. -* Fix: A str_replace(): Passing null to parameter #3 deprecated message has been fixed. -* Fix: Stripe payments using the action included in this plugin would fail to initialize when using shortcode amount values for many currency types including Mexican Pesos. -* Fix: An array to string conversion PHP warning has been fixed. -* Fix: The center form styling toggle would not properly save. -* Fix: Form fields would appear broken when the Payment forms by Paystack plugin was active due to a shortcode conflict. -* Several deprecated functions have been removed including FrmAppController::page_route, FrmFieldType::default_invalid_msg, FrmFieldType::default_unique_msg, FrmStylesHelper::maybe_include_font_icon_css, FrmFormsHelper::ignore_template_categories, FrmFormActionsHelper::default_action_opts, and FrmAppHelper::maybe_full_screen_link. -* The unused FrmEDD_SL_Plugin_Updater class has been deprecated and is no longer functional. - [See changelog for all versions](https://raw.githubusercontent.com/Strategy11/formidable-forms/master/changelog.txt) == Upgrade Notice == diff --git a/stripe/controllers/FrmTransLiteHooksController.php b/stripe/controllers/FrmTransLiteHooksController.php index 0009020ed7..3fda1945ba 100755 --- a/stripe/controllers/FrmTransLiteHooksController.php +++ b/stripe/controllers/FrmTransLiteHooksController.php @@ -34,6 +34,13 @@ public static function load_hooks() { * @return void */ public static function load_admin_hooks() { + add_action( + 'admin_init', + function () { + self::fix_addon_hooks(); + } + ); + if ( class_exists( 'FrmTransHooksController', false ) ) { // Exit early, let the Payments submodule handle everything. return; @@ -57,4 +64,34 @@ private static function load_ajax_hooks() { add_action( 'wp_ajax_frm_trans_refund', 'FrmTransLitePaymentsController::refund_payment' ); add_action( 'wp_ajax_frm_trans_cancel', 'FrmTransLiteSubscriptionsController::cancel_subscription' ); } + + /** + * Make sure that Payments appear when there are inbox items for all Payments plugins. + * + * @since 6.17.1 + * + * @return void + */ + private static function fix_addon_hooks() { + $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count(); + if ( ! $unread_count ) { + // Nothing to fix. + return; + } + + $menu_name = FrmAppHelper::get_menu_name(); + $hook_name = 'manage_' . sanitize_title( $menu_name ) . '-' . $unread_count . '_page_formidable-payments_columns'; + + if ( FrmTransLiteAppHelper::should_fallback_to_paypal() && is_callable( 'FrmPaymentsController::payment_columns' ) ) { + // Fallback to PayPal add-on. + add_filter( $hook_name, 'FrmPaymentsController::payment_columns' ); + } elseif ( is_callable( 'FrmTransListsController::payment_columns' ) ) { + // Fallback to the Payments submodule. + add_filter( $hook_name, 'FrmTransListsController::payment_columns' ); + } else { + return; + } + + add_filter( 'screen_options_show_screen', 'FrmTransLiteListsController::remove_screen_options', 10, 2 ); + } } diff --git a/stripe/controllers/FrmTransLiteListsController.php b/stripe/controllers/FrmTransLiteListsController.php index 5ea36073ca..ed2474c528 100755 --- a/stripe/controllers/FrmTransLiteListsController.php +++ b/stripe/controllers/FrmTransLiteListsController.php @@ -13,7 +13,9 @@ public static function add_list_hooks() { return; } - $hook_name = 'manage_' . sanitize_title( FrmAppHelper::get_menu_name() ) . '_page_formidable-payments_columns'; + $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count(); + $hook_name = 'manage_' . sanitize_title( FrmAppHelper::get_menu_name() ) . ( $unread_count ? '-' . $unread_count : '' ) . '_page_formidable-payments_columns'; + add_filter( $hook_name, __CLASS__ . '::payment_columns' ); add_filter( 'screen_options_show_screen', __CLASS__ . '::remove_screen_options', 10, 2 ); } @@ -91,6 +93,12 @@ public static function remove_screen_options( $show_screen, $screen ) { } $menu_name = sanitize_title( FrmAppHelper::get_menu_name() ); + + $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count(); + if ( $unread_count ) { + $menu_name .= '-' . $unread_count; + } + if ( $screen->id === $menu_name . '_page_formidable-payments' ) { $show_screen = false; } diff --git a/stubs.php b/stubs.php index eaeb99386f..bce0038996 100644 --- a/stubs.php +++ b/stubs.php @@ -321,6 +321,12 @@ public function __construct( $exceptions = null ) { } class FrmPaymentsController { public static $db_opt_name = 'frm_pay_db_version'; + /** + * @param array $cols + * @return array + */ + public static function payment_columns( $cols = array() ) { + } } class FrmProDashboardHelper { /** @@ -402,6 +408,14 @@ function WP_Optimize() { */ function w3tc_flush_all( $extras = null ) { } + class FrmTransListsController { + /** + * @param array $columns + * @return array + */ + public static function payment_columns( $columns = array() ) { + } + } } namespace Elementor {