WBCE / WBCE_CMS

Core package of WBCE CMS. This package includes the core and the default addons. Visit https://wbce.org (DE) or https://wbce-cms.org (EN) to learn more or to join the WBCE CMS community.
https://wbce-cms.org
GNU General Public License v2.0
31 stars 22 forks source link

show_menu2 loses navigation on search results #496

Closed instantflorian closed 3 years ago

instantflorian commented 3 years ago

When show_menu2 is called with SM2_TRIM as 3rd parameter, the navigation disappears on pages without ID (like search results, login, signup). Seemingly it is caused by the conditions "(is_countable($wb->page)" and so also "count($wb->page) == 0" in line 94f. of the modules/show_menu2/include.php, which are never true. So, changing the code to $CURR_PAGE_ID = defined('REFERRER_ID') ? REFERRER_ID : PAGE_ID; if ( defined('REFERRER_ID') && REFERRER_ID > 0) { global $database;
$sSql = 'SELECT * FROM {TP}pages WHERE page_id = '.REFERRER_ID.''; $result = $database->query($sSql); if ($result->numRows() == 1) { $wb->page = $result->fetchRow(); } unset($result); } does the trick afaik, but I'm not sure if that really has no unwanted results, and I also wonder why the original code obviously does not work properly any longer.