We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "Search Everything" field/choice on the Search Bar can search for information inside entries not displayed on the View as fields/columns.
This is not a bug because we are replicating the "Any form field" option of Gravity Forms on the Entries page:
Example:
But the information appears in another field:
The same is true for the View:
The text was updated successfully, but these errors were encountered:
https://secure.helpscout.net/conversation/2841893481/61189
Sorry, something went wrong.
We can fix this pretty easily for GravityView; but I think it should be a View setting.
We only need to
left
field_id
GF_Query_Column::META
GF_Query_Condition
meta_key
partial code:
add_action( 'gravityview/view/query', function ( $query, $view ) { $update_conditions = static function ( GF_Query $query, GF_Query_Condition $condition, $fields ) use ( & $update_conditions ): GF_Query_Condition { if ( in_array( $condition->operator, [ GF_Query_Condition::_AND, GF_Query_Condition::_OR ], true ) ) { $expressions = array_map( static function ( GF_Query_Condition $expression ) use ( $query, $fields, $update_conditions ) { return $update_conditions( $query, $expression, $fields ); }, $condition->expressions ?? [] ); return $condition->operator === GF_Query_Condition::_AND ? GF_Query_Condition::_and( ...$expressions ) : GF_Query_Condition::_or( ...$expressions ); } if ( ! $condition->left instanceof GF_Query_Column || $condition->left->field_id !== GF_Query_Column::META || ! array_key_exists( $condition->left->source, $fields ) ) { return $condition; } $source = $condition->left->source; // If an array is set, but it is empty; it should exclude aLL values; so we replace it with an invalid statement. if ( ! $fields[ $source ] ) { return new GF_Query_Condition( $condition->left, GF_Query_Condition::EQ, new GF_Query_Literal( '__GK_NO_MATCH__' ), ); } $key_condition = new GF_Query_Condition( new GF_Query_Column( 'meta_key', $condition->left->source, $query->_alias( GF_Query_Column::META, $source, 'm' ) ), GF_Query_Condition::IN, new GF_Query_Series( array_map( static function ( $field_id ) { return new GF_Query_Literal( $field_id ); }, $fields[ $source ] ) ) ); return GF_Query_Condition::_and( $condition, $key_condition ); }; $where = $query->_introspect()['where']; // Retrieve visible fields per form on the View. $fields = [ '6' => [ '1' ], '7' => [ '1', '3'], ]; $where = $update_conditions( $query, $where, $fields ); $query->where( $where ); // lets-a-go! }, 2048, 2 ); // Extra late execution for Multiple Forms.
No branches or pull requests
The "Search Everything" field/choice on the Search Bar can search for information inside entries not displayed on the View as fields/columns.
This is not a bug because we are replicating the "Any form field" option of Gravity Forms on the Entries page:
Example:
But the information appears in another field:
The same is true for the View:
The text was updated successfully, but these errors were encountered: