Please upgrade here. These earlier versions are no longer being updated and have security issues.

Search results, wrong default value

This discussion is related to the Vanilla addon.
GermontGermont New
edited November 2016 in Vanilla 2.0 - 2.3

This is strange. Why would any developer would configure a default search value of 0 results per page, considering there are also beginners like me.
I had to modify this line in /forum/conf/config.php:
$Configuration['Garden']['Search']['PerPage'] = '10';

Other than that, thank you for a great software ;)

Tagged:

Comments

  • @Germont said:
    This is strange. Why would any developer would configure a default search value of 0 results per page,
    considering there are also beginners like me.
    I had to modify this line in /forum/conf/config.php:
    $Configuration['Garden']['Search']['PerPage'] = '10';

    Other than that, thank you for a great software ;)

    It is strange how you got zero, considering ....

    There will be no line relating to $Configuration['Garden']['Search']['PerPage'] in your config.php or the config-defaults.php.

    Unless you manually add the line the search result will default to 20.

    There is nothing in the core vanilla code which would force 0 results per page.

    https://github.com/vanilla/vanilla/blob/ec5b13f6713dae42cd835267cea328d8e8559432/applications/dashboard/controllers/class.searchcontroller.php#L77

        list($Offset, $Limit) = offsetLimit($Page, c('Garden.Search.PerPage', 20));
        $this->setData('_Limit', $Limit);
    

    in this case if you didn't manually add the config line to your config.php the default would be 20 for the limit (NOT 0).

    if you remove $Configuration['Garden']['Search']['PerPage'] from your config.php, you will see that the default is NOT 0 but 20.

    There are many config statements that are not set by the dashboard. this is one of them.

    these are some of the settings that can get changed via advanced...

    https://github.com/vanilla/vanilla/blob/211f70c9c918785d2eb0c1a261d27f2a91258b32/applications/vanilla/controllers/class.vanillasettingscontroller.php#L44-L52

    some may not occur in your config.php unless you save from the advanced screen.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

Sign In or Register to comment.