Hi,
I'm using WB2.81 and I've noticed that the frontend search facility returns results which include sub pages of parent or root_parent pages which have a visibility of none. My site has sections which are turned on and off seasonally so we set them to none when we don't want them to display. Each section has a lot of sub pages so setting the visibility for each sub page is not really an option.
Is there a way to change the search code so that it does not return results which include sub pages of parent pages that are set to "none"?
The search code, as far as I can tell, is in search/search.php:
$sections_query = $database->query("
SELECT s.section_id, s.page_id, s.module, s.publ_start, s.publ_end,
p.page_title, p.menu_title, p.link, p.description, p.keywords, p.modified_when, p.modified_by,
p.visibility, p.viewing_groups, p.viewing_users
FROM $table_s AS s INNER JOIN $table_p AS p ON s.page_id = p.page_id
WHERE s.module = '$module_name' AND p.visibility NOT IN ('none','deleted') AND p.searching = '1' $search_path_SQL $search_language_SQL
ORDER BY s.page_id, s.position ASC
");
"p.visibility NOT IN ('none','deleted')" works where the sub page itself has a visibility of none but I'm not sure how to change the query to check for the visibility of parent and root_parent pages where they are none.
Can anyone point me in the right direction please? Any help would be appreciated.
Many thanks.