Random not working when homepage is set as "route explorer"

Status
Not open for further replies.

Rodolfo

Chevereto Developer
Chevereto Staff
I've confirmed that when your homepage is set as "route explorer" the ?rand doesn't work. The language selection ?lang=<code> doesn't work either.

To fix it, use this open app/routes/route.index.php and change this:

PHP:
        if(CHV\Settings::get('homepage_style') == 'route_explore') {
            $handler::mapRoute('explore');
            include G_APP_PATH_ROUTES . 'route.explore.php';
            return $route($handler);
        }
To this:
PHP:
        // Process the index query string requests like "?lang=en"
        parse_str($_SERVER['QUERY_STRING'], $querystr);
       
        if(!in_array(key($querystr), ['random', 'lang']) and CHV\Settings::get('homepage_style') == 'route_explore') {
            $handler::mapRoute('explore');
            include G_APP_PATH_ROUTES . 'route.explore.php';
            return $route($handler);
        }
 
Status
Not open for further replies.
Top