From fcea1b1d0181a2b25a16199baa192517595327b5 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Mon, 2 Apr 2018 13:30:57 -0600 Subject: [PATCH] Fix fatal error :facepunch: Ouch https://wordpress.org/support/topic/directory-not-working/ --- gravity-forms-addons.php | 21 ++++++++++++++++----- readme.txt | 6 +++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gravity-forms-addons.php b/gravity-forms-addons.php index c1c2bb7..0245868 100644 --- a/gravity-forms-addons.php +++ b/gravity-forms-addons.php @@ -4,7 +4,7 @@ Plugin URI: https://katz.co/gravity-forms-addons/ Description: Turn Gravity Forms into a great WordPress directory...and more! Author: Katz Web Services, Inc. -Version: 4.1.1 +Version: 4.1.2 Author URI: https://gravityview.co Text Domain: gravity-forms-addons License: GPLv2 or later @@ -35,7 +35,7 @@ class GFDirectory { private static $path = "gravity-forms-addons/gravity-forms-addons.php"; private static $slug = "gravity-forms-addons"; - private static $version = "4.1.1"; + private static $version = "4.2"; private static $min_gravityforms_version = "2.2.3.12"; public static function directory_defaults( $args = array() ) { @@ -1410,7 +1410,7 @@ public static function make_directory( $atts ) { } // 2.3 supports $smartapproval out of the box - if( $smartapproval && $enable_smart_approval && version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) { + if( $smartapproval && $enable_smart_approval && self::us_gf_23_db() ) { $search_criteria['field_filters'][] = array( 'key' => 'is_approved', @@ -1830,6 +1830,17 @@ class="displaying-num">=' ); + } + /** * Render image link HTML * @@ -2312,7 +2323,7 @@ public static function get_leads( $form_id, $sort_field_number = 0, $sort_direct $return = GFAPI::get_entries( $form_id, $search_criteria, $sorting, $paging, $total_count ); // Gravity Forms 2.3 supports smart approval out of the box. Before then, nope! - if ( ! version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) { + if ( ! self::use_gf_23_db() ) { $entry_ids = array(); foreach ( $return as $l ) { @@ -2832,7 +2843,7 @@ public static function save_lead( $form, &$lead ) { } - if ( version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) { + if ( self::use_gf_23_db() ) { $entry_meta_table = RGFormsModel::get_entry_meta_table_name(); $current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT id, meta_key FROM $entry_meta_table WHERE entry_id=%d", $lead['id'] ) ); } else { diff --git a/readme.txt b/readme.txt index 5dc4c9b..d66d8ab 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Tags: gravity forms, gravity form, forms, gravity, form, directory, business, business directory, directorypress, classifieds, cforms, formidable, gravityview Requires at least: 4.0 Tested up to: 4.9.4 -Stable tag: 4.1.1 +Stable tag: 4.1.2 Contributors: katzwebdesign, katzwebservices License: GPLv2 or later Donate link: https://gravityview.co/?utm_source=wordpress&utm_medium=readme&utm_campaign=donate @@ -236,6 +236,10 @@ Since 4.1, Smart Approval may return inaccurate entry counts. This will be fixed == Changelog == += 4.1.2 on April 2, 2018 = + +* Fixed: Check whether a function exists that was introduced in Gravity Forms 2.2 + = 4.1.1 on March 30, 2018 = * Fixed: Searching entries using the global search would not filter entries