issue #2027 search with contextual values in filters

* valide for all filters, except "album" (for now)
This commit is contained in:
plegall
2023-10-22 21:03:53 +02:00
parent ebc741f3b5
commit 8aa597cd95
2 changed files with 59 additions and 13 deletions
+10
View File
@@ -408,6 +408,8 @@ function get_regular_search_results($search, $images_where='')
$logger->debug(__FUNCTION__, 'search', $search);
$has_filters_filled = false;
$forbidden = get_sql_condition_FandF(
array
(
@@ -423,6 +425,11 @@ function get_regular_search_results($search, $images_where='')
if (isset($search['fields']['tags']))
{
if (!empty($search['fields']['tags']['words']))
{
$has_filters_filled = true;
}
$tag_items = get_image_ids_for_tags(
$search['fields']['tags']['words'],
$search['fields']['tags']['mode']
@@ -435,6 +442,8 @@ function get_regular_search_results($search, $images_where='')
if (!empty($search_clause))
{
$has_filters_filled = true;
$query = '
SELECT DISTINCT(id)
FROM '.IMAGES_TABLE.' i
@@ -484,6 +493,7 @@ SELECT DISTINCT(id)
'search_details' => array(
'matching_cat_ids' => $matching_cat_ids,
'matching_tag_ids' => $matching_tag_ids,
'has_filters_filled' => $has_filters_filled,
),
);
}