Skip to content

Commit

Permalink
fix: email1 field support
Browse files Browse the repository at this point in the history
without this workaround the where clause is invalid
  • Loading branch information
mrbarletta authored Jun 6, 2019
1 parent 37384a2 commit 0a361e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion graphql/Schema/ListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ function ListHelper($module, $value = null, $args = [], Youshido\GraphQL\Execut
$searchFields[$key] = array('query_type' => 'default', 'value' => $value, 'enable_range_search'=> true, 'is_date_field'=>true);
}
}

// Work around for email1 field, it cannot be used in the where clause as it an alias.
if (!empty($searchFields["email1"]) && isset($moduleBean->field_defs['email1'])) {
$searchFields["email_addresses.email_address"] = $searchFields["email1"];
unset($searchFields["email1"]);
}
$where=searchHelper::generateSearchWhere($moduleBean, $searchFields);
$offset=0;
if (!empty($args['offset'])) {
Expand Down

0 comments on commit 0a361e5

Please sign in to comment.