Skip to content

Commit

Permalink
Merge pull request #15 from katzwebservices/bug/gf-like-query
Browse files Browse the repository at this point in the history
Apparently GFAPI is not supporting LIKE operator
  • Loading branch information
zackkatz committed Aug 19, 2015
2 parents 4cb6e8d + 360faff commit 426126b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gravityview-az-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Plugin Name: GravityView A-Z Filters Extension
* Plugin URI: https://gravityview.co/extensions/a-z-filter/
* Description: Alphabetically filter your entries.
* Version: 1.0.5
* Version: 1.0.6
* Author: Katz Web Services, Inc.
* Author URI: https://gravityview.co
* Author Email: [email protected]
* Requires at least: 3.8
* Tested up to: 4.2.2
* Tested up to: 4.3
* Text Domain: gravityview-az-filters
* Domain Path: languages
*/
Expand Down Expand Up @@ -42,7 +42,7 @@ class GravityView_A_Z_Entry_Filter_Extension extends GravityView_Extension {

protected $_title = 'A-Z Filters';

protected $_version = '1.0.5';
protected $_version = '1.0.6';

protected $_text_domain = 'gravityview-az-filters';

Expand Down
Binary file modified languages/gravityview-az-filters-fr_FR.mo
Binary file not shown.
8 changes: 4 additions & 4 deletions languages/gravityview-az-filters-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ msgid ""
msgstr ""
"Project-Id-Version: GravityView A-Z Filters\n"
"POT-Creation-Date: 2014-10-03 09:41-0700\n"
"PO-Revision-Date: 2014-10-03 15:42+0000\n"
"PO-Revision-Date: 2015-07-23 17:49+0000\n"
"Last-Translator: Zachary Katz <[email protected]>\n"
"Language-Team: French (France) (http://www.transifex.com/projects/p/gravityview-az-filters/language/fr_FR/)\n"
"Language-Team: French (France) (http://www.transifex.com/katzwebservices/gravityview-az-filters/language/fr_FR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -21,12 +21,12 @@ msgstr ""
#: lib/class-gravityview-extension.php:157
#, php-format
msgid "Could not activate the %s Extension; GravityView is not active."
msgstr ""
msgstr "Impossible d'activer l'extension %s; GravityView n'est pas activé."

#: lib/class-gravityview-extension.php:167
#, php-format
msgid "The %s Extension requires GravityView Version %s or newer."
msgstr ""
msgstr "L'extension %s nécessite la version %s de GravityView ou ultérieure."

#: widget/gravityview-a-z-entry-filter-widget.php:35
msgid "A-Z Entry Filter"
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Alphabetically filter your entries.

== Changelog ==

= 1.0.6 on August 18 =
* Fixed: Conflict with Gravity Forms 1.9.12+ preventing the A-Z filter from retrieving values

= 1.0.5 on July 20 =
* Fixed: Sanitize links to improve security
* Fixed: Link to "[Use this field to filter entries](http://docs.gravityview.co/article/198-the-use-this-field-to-filter-entries-setting)" documentation
Expand Down
5 changes: 4 additions & 1 deletion widget/gravityview-a-z-entry-filter-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ function filter_entries( $search_criteria ) {
return $search_criteria;
}

// After 1.9.12, GF changed search operator options
$filter_operator = version_compare( GFCommon::$version, '1.9.12', '>=' ) ? 'contains' : 'like';

foreach ($gravityview_view->widgets as $zone => $areas) {

// Get all the widgets that have ID of `az_filter`
Expand Down Expand Up @@ -295,7 +298,7 @@ function filter_entries( $search_criteria ) {
'key' => $widget['filter_field'], // The field ID to search e.g. 1.3 is the First Name

'value' => '[GRAVITYVIEW_AZ_FILTER_REPLACE]'.$letter, // The value to search
'operator' => 'like', // Will use wildcard `%search%` format
'operator' => $filter_operator, // Will use wildcard `%search%` format
);

$search_criteria['field_filters'][] = $filter;
Expand Down

0 comments on commit 426126b

Please sign in to comment.