mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-30 05:24:05 +02:00
fixes #739, make sure keys are reset in the "uniquified" array
... for a regular search, when different set of photos matches the search.
This commit is contained in:
@@ -269,10 +269,17 @@ SELECT DISTINCT(id)
|
|||||||
|
|
||||||
if (isset($search_in_tags_items))
|
if (isset($search_in_tags_items))
|
||||||
{
|
{
|
||||||
$items = array_unique(
|
// TODO the sorting order will not match $conf['order_by'], a solution would be
|
||||||
array_merge(
|
// to have a new SQL query 'where id in (merged ids) order by $conf[order_by]'
|
||||||
$items,
|
//
|
||||||
$search_in_tags_items
|
// array_values will reset the numeric keys, without changing the sorting order.
|
||||||
|
// picture.php relies on these keys to be sequential {0,1,2} and not {0,1,5}
|
||||||
|
$items = array_values(
|
||||||
|
array_unique(
|
||||||
|
array_merge(
|
||||||
|
$items,
|
||||||
|
$search_in_tags_items
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -292,10 +299,12 @@ SELECT DISTINCT(id)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'OR':
|
case 'OR':
|
||||||
$items = array_unique(
|
$items = array_values(
|
||||||
array_merge(
|
array_unique(
|
||||||
$items,
|
array_merge(
|
||||||
$tag_items
|
$items,
|
||||||
|
$tag_items
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user