saberland/saber

Do you want to work on this issue?

You can request for a bounty in order to promote it!

saber-plugin-query-posts: Pagination 'next' and 'prev' links seems to be incorrect #559

samoraa posted onGitHub

<!-- Please don't delete this template or we'll close your issue -->

<!-- Before creating an issue please make sure you are using the latest version of Saber. -->

<!-- Issues which contain questions or support requests will be closed. -->

<!-- Please ask questions via following several ways. -->

<!-- https://chat.saber.land/ -->

<!-- https://stackoverflow.com/questions/ask?tags=saberjs -->

Bug report

Steps to reproduce

Fresh install Saber, install and followed saber-plugin-query-posts readme to make a blog post with pagination.

<!-- If you are reporting a bug that can ONLY be reproduced on your repository, PLEASE provide this repo link. That takes guessing work out of the way and saves us time. -->

<!-- You can also use this CodeSandbox starter https://bit.ly/2IlcpNF -->

What is expected?

On the first paginated page, hasNext should be true, hasPrev should be false, same for nextLink and prevLink

Screenshot from 2019-11-08 14-24-58

What is actually happening?

hasNext and hasPrev seems to be reversed

Screenshot from 2019-11-08 14-36-15 First page

Screenshot from 2019-11-08 14-36-39 Second page

Other relevant information

  • Result of running saber -v: latest
  • Browser version (optional): Chromium version 78.0.3904.87 (Official Build) Arch Linux (64-bit)
  • Is Saber a global or local install? Local
  • Which package manager did you use for the install? NPM
  • Does this issue occur when all plugins are disabled? No

Awesome Saber! :zap:


Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.86. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

posted by issue-label-bot[bot] over 5 years ago

I think it's showing the latest posts first, therefore hasPrev would mean has previous posts? As you can see, The order of the posts is

My Example Post 4
My Example Post 3
My Example Post 2

Therefore it's a question of semantics and not really a bug. You could rename the Prev Page link to read Older posts instead, and the behaviour would be correct, right?

posted by andreasvirkus over 5 years ago

Maybe we should reverse that, it seems everyone else is using next for older stuff 😅

posted by egoist over 5 years ago

@andreasvirkus Okay that make sense, yes you're right, I am using that for workaround now. Thanks!

posted by samoraa over 5 years ago

@egoist would you want to switch the wording? Should we keep this backwards compatible? Or is it a suitable breaking change for v1?

posted by andreasvirkus over 5 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests