Skip to content

Commit

Permalink
Check type list for content before attempting to filter. Should resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
collectiveaccess committed Aug 17, 2024
1 parent 64a95db commit 2a29e87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/lib/Browse/BrowseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -8007,7 +8007,10 @@ private function _getRelativeFacetSQLData($ps_relative_to_table, $pa_options) {
$va_wheres[] = "(".$this->ops_browse_table_name.".access IN (".join(',', $pa_options['checkAccess'])."))";
}
if (isset($pa_options['restrict_to_relationship_types']) && is_array($pa_options['restrict_to_relationship_types']) && sizeof($pa_options['restrict_to_relationship_types']) && $t_item_rel && $t_item_rel->hasField('type_id')) {
$va_wheres[] = "(".$t_item_rel->tableName().".type_id IN (".join(",", caMakeRelationshipTypeIDList($t_item_rel->tableName(), $pa_options['restrict_to_relationship_types']))."))";
$res_type_ids = caMakeRelationshipTypeIDList($t_item_rel->tableName(), $pa_options['restrict_to_relationship_types']);
if(sizeof($res_type_ids ?? [])) {
$va_wheres[] = "(".$t_item_rel->tableName().".type_id IN (".join(",", $res_type_ids)."))";
}
}

return array('joins' => $va_joins, 'wheres' => $va_wheres);
Expand Down

0 comments on commit 2a29e87

Please sign in to comment.