Skip to content

Commit

Permalink
Merge 'develop' and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcasual committed May 27, 2024
2 parents 4077c2a + 0676637 commit bec9580
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/widgets/search-widget/class-search-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ public function gf_query_filter( &$query, $view, $request ) {
$left = new GF_Query_Column( $left->field_id, $left->source, $alias );
}

if ( $this->is_product_field( $filter ) ) {
if ( $this->is_product_field( $filter ) && ( $filter['is_numeric'] ?? false ) ) {
$original_left = clone $left;
$column = $left instanceof GF_Query_Call ? $left->columns[0] ?? null : $left;
$column_name = sprintf( '`%s`.`%s`', $column->alias, $column->is_entry_column() ? $column->field_id : 'meta_value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$gravityview_view = GravityView_View::getInstance();
$search_field = $gravityview_view->search_field;

if ( ! is_string( $search_field['value'] ?? '' ) ) {
$search_field['value'] = '';
}

?>
<div class="gv-search-box gv-search-field-text">
<?php if ( ! gv_empty( $search_field['label'], false, false ) ) { ?>
Expand All @@ -16,4 +20,4 @@
<p>
<input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>">
</p>
</div>
</div>
10 changes: 9 additions & 1 deletion tests/unit-tests/GravityView_Widget_Search_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ public function test_search_with_number_field() {
'form_id' => $form['id'],
'status' => 'active',
'9' => $number,
'26' => 'product name|' . $currency_symbol . $number,
'26' => 'product name ' . $number . '|' . $currency_symbol . $number,
) );
}

Expand Down Expand Up @@ -1877,6 +1877,14 @@ public function test_search_with_number_field() {
$_GET = [ 'filter_26' => [ 'min' => -20, 'max' => 7 ], 'mode' => 'all' ];
$this->assertEquals( 3, $view->get_entries()->count() );

// Make sure searching on text still works.
$_GET = ['filter_26' => 'product'];
$this->assertEquals( 5, $view->get_entries()->count() );

$_GET = ['filter_26' => 'name 7'];
$this->assertEquals( 1, $view->get_entries()->count() );


$_GET = array();
}
}
26 changes: 13 additions & 13 deletions translations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-05-19T13:35:37+00:00\n"
"POT-Creation-Date: 2024-05-23T12:44:30+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down Expand Up @@ -4606,48 +4606,48 @@ msgstr ""
msgid "Entry Creator"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:1817
#: includes/widgets/search-widget/class-search-widget.php:1808
msgid "Search Entries:"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:1820
#: includes/widgets/search-widget/class-search-widget.php:1811
msgid "Filter by date:"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:1823
#: includes/widgets/search-widget/class-search-widget.php:1814
msgid "Entry ID:"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2153
#: includes/widgets/search-widget/class-search-widget.php:2144
msgid "Clear"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2243
#: includes/widgets/search-widget/class-search-widget.php:2234
msgctxt "Close calendar"
msgid "Close"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2244
#: includes/widgets/search-widget/class-search-widget.php:2235
msgctxt "Previous month in calendar"
msgid "Prev"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2245
#: includes/widgets/search-widget/class-search-widget.php:2236
msgctxt "Next month in calendar"
msgid "Next"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2246
#: includes/widgets/search-widget/class-search-widget.php:2237
msgctxt "Today in calendar"
msgid "Today"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2247
#: includes/widgets/search-widget/class-search-widget.php:2238
msgctxt "Week in calendar"
msgid "Week"
msgstr ""

#: includes/widgets/search-widget/class-search-widget.php:2248
#: includes/widgets/search-widget/class-search-widget.php:2239
msgid "Show a different month"
msgstr ""

Expand Down Expand Up @@ -4794,11 +4794,11 @@ msgstr ""
msgid "%s (%d out of %d stars)"
msgstr ""

#: vendor_prefixed/gravitykit/foundation/src/Components/NewsletterSignup.php:184
#: vendor_prefixed/gravitykit/foundation/src/Components/NewsletterSignup.php:221
msgid "The provided email address is not valid."
msgstr ""

#: vendor_prefixed/gravitykit/foundation/src/Components/NewsletterSignup.php:212
#: vendor_prefixed/gravitykit/foundation/src/Components/NewsletterSignup.php:249
msgid "Something went wrong on our end. Please try again later."
msgstr ""

Expand Down

0 comments on commit bec9580

Please sign in to comment.