Skip to content

Commit

Permalink
fix: correct ids relation in the degree programs overview shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyian committed May 29, 2024
1 parent 8294700 commit 0003ae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Infrastructure/Repository/WpQueryArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public function withOrderBy(array $orderBy): self
return $this->withArg('orderby', $orderBy);
}

public function withTaxQueryItem(array $item): self
public function withTaxQueryItem(array $item, string $relation = 'AND'): self
{
$instance = clone $this;

$instance->args['tax_query'] = (array) ($instance->args['tax_query']
?? ['relation' => 'AND']);
?? ['relation' => $relation]);

$instance->args['tax_query'][] = $item;

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Repository/WpQueryArgsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function applyHisCode(string $hisCode, WpQueryArgs $queryArgs): WpQueryAr
];
}

return $queryArgs->withTaxQueryItem($taxQueryItem);
return $queryArgs->withTaxQueryItem($taxQueryItem, 'OR');
} catch (RuntimeException) {
/*
* Return an empty result if one or more campo keys in HIS code are not matched to any terms.
Expand Down

0 comments on commit 0003ae4

Please sign in to comment.