fix next button in pagination disappears on certain page
also fix pagination not updated when switching from a non-empty to an empty result list
Merge pull request #1937 from 0xF013/feature/15598-next-button-in-pagination-disappears-on-certain-page

fix next button in pagination disappears on certain page