Problem with search results

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 16, 2013   (RSS)

By pault - May 16, 2013

I have an installation of CMS Builder where within a particular section, it's not possible to view the second page of results within the CMS.

So, by default this section has 25 records shown per page in the CMS.  If I perform a search that returns more than 25 records, then the system shows be that there are so many records and so many pages but as soon as I click 'Next Page' to see the next set of 25 results, the search is reset and all records are displayed.

I've updated the system to the latest version of CMSB but have the same problem.

This doesn't happen on a different section but I can't see anything unusual about the sectiont that has the problem.

Do you have any ideas please?

Thanks, Paul.

By gkornbluth - May 16, 2013

Hi Paul,

This might not be the final solution, but: if you go to the Section Editor section in the left hand menu, then click modify on a section you want to edit. At the top of the modify section page should be 5 tabs, if you select the advanced tab you should see a per page drop down that allows you to select how many records should be displayed per page. Unfortunately this is only a per editor solution.

You can also search through the site's schema files and replace all occurrences of '_perPageDefault' => '25', with '_perPageDefault' => '1000'.

Dave Edis also offered a plugin for version 2.51 and above, that will change all of the default per page values on your site to any value you need.

He suggests backing up all of your /data/schema/ files first and then try this:

Copy the code below to as blank document, name it perpagechanger.php, upload it to your plugins folder and activate the plugin under Admin>plugins.

<?php


### UPDATE THESE VALUES
$GLOBALS['PERPAGECHANGER_NEWVALUE'] = 1000; //

// DON'T UPDATE ANYTHING BELOW THIS LINE

// plugin menu - add link
pluginAction_addHandlerAndLink(t('Update Sections'), 'perPageChanger', 'admins');

//
function perPageChanger() {
foreach (getSchemaTables() as $tableName) {
$schema = loadSchema($tableName);
$schema['_perPageDefault'] = $GLOBALS['PERPAGECHANGER_NEWVALUE'];
saveSchema($tableName, $schema);
alert("Updated '$tableName' to have a per page default value of {$GLOBALS['PERPAGECHANGER_NEWVALUE']}\n");
}
}

?>

Hope that helps,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php