Author Topic: Problem with search results in SP7  (Read 398 times)

Offline Ruud

  • Posts: 3641
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Problem with search results in SP7
« on: October 07, 2016, 01:57:09 PM »
Using SP7 on a website using multiple blocks, the search results are displayed together with other blocks of the homepage.
This is caused by a flaw in class.frontend.php in the page_select() function.

On line 104 of class.frontend.php it says:
Code: [Select]
if (!isset($page_id) || !intval($page_id)) {Now the searchresult creates a $page_id = 0; what will be the same as !intval($page_id).
Therefore the $wb->page_id is set to $wb->default_page_id causing the page_content(2) (or higher) function to use that $wb->page_id.

Previous versions (and the working solution) use:
Code: [Select]
if (!isset($page_id) || !is_numeric($page_id)) {The is_numeric() detects the $page_id=0 correctly, and the result is as it should be (only search output in page_content(1)  and nothing in other blocks).

This needs to be fixed!!