Show Older Items is missing since update

beerForo

Well-known member
Licensed customer
Affected version
2.3.8
Show Older Items is missing in search since the last update. Search results now end at 10 pages with no button available to show more.
 
Last edited:
I just realized this myself and came to post a bug report about it.

Hope they fix it fast, this is a huge feature, I wonder if it will affect SEO and indexed pages?
 
Code:
--- SearchController.php.OLD    2026-01-31 11:09:24.019393277 +0100
+++ SearchController.php    2026-01-31 11:06:31.257218063 +0100
@@ -233,7 +233,7 @@
         if (
             $search->search_order === 'date'
             && $search->result_count > $perPage
-            && $page === $maxPage
+            && $page >= $maxPage
         )
         {
             $lastResult = $resultSet->getLastResultData($lastResultType);
 
Code:
--- SearchController.php.OLD    2026-01-31 11:09:24.019393277 +0100
+++ SearchController.php    2026-01-31 11:06:31.257218063 +0100
@@ -233,7 +233,7 @@
         if (
             $search->search_order === 'date'
             && $search->result_count > $perPage
-            && $page === $maxPage
+            && $page >= $maxPage
         )
         {
             $lastResult = $resultSet->getLastResultData($lastResultType);
This code exists (===) in 2.3.7 so i'm not sure why the 2.3.8 upgrade would break it.

There must be another area that effects this?

2.3.6 is slightly different with the double ==.

Code:
$maxPage = ceil($search->result_count / $perPage);
        if ($search->search_order == 'date'
            && $search->result_count > $perPage
            && $page == $maxPage)
        {
            $lastResult = $resultSet->getLastResultData($lastResultType);
            $getOlderResultsDate = $searcher->handler($lastResultType)->getResultDate($lastResult);
        }
        else
        {
            $getOlderResultsDate = null;
        }
 
Replacing this from 2.3.9 ....
Code:
      if (
         $search->search_order === 'date'
         && $search->result_count > $perPage
         && $page === $maxPage
      )
      {
         $lastResult = $resultSet->getLastResultData($lastResultType);
         $lastResultHandler = $searcher->handler($lastResultType);
         $getOlderResultsDate = $lastResultHandler->getResultDate($lastResult);
      }
      else
      {
         $getOlderResultsDate = null;
      }

To this from the earlier version 2.3.6 .....


Code:
        if ($search->search_order == 'date'
            && $search->result_count > $perPage
            && $page == $maxPage)
        {
            $lastResult = $resultSet->getLastResultData($lastResultType);
            $getOlderResultsDate = $searcher->handler($lastResultType)->getResultDate($lastResult);
        }
        else
        {
            $getOlderResultsDate = null;
        }

...adds a working button to 'View older results' as such....

1770994415133.webp


However, the page pagination then starts at '1' to '10' whereas you'd expect it to be '11' to '20' (etc)....

1770994465090.webp


I don't know if doing so affects other functionality though, perhaps @Chris D could shed some light on it?


(/src/XF/Pub/Controller/SearchController.php)
 
Since I finally got round to bumping a board from 2.2 to 2.3.9 I came looking to see if there had been a resolution or response from XF yet. I'd certainly prefer the previous functionality or at least to know why that was an issue and needed removing.
 
Bumping max results to the permitted 1000 max helps somewhat, but our board goes back over two decades (imported from vBulletin, and I think UBB before that) so sometimes even that isn't enough.
 
Back
Top Bottom