Skip to content

Conversation

@mauriac
Copy link
Member

@mauriac mauriac commented Apr 3, 2022

What?

This PR changes previous link or next link in comments pagination when their link do not have the same markup with pagination number link.

Why?

Fixes #37561

How?

Testing Instructions

Screenshots or screencast

@mauriac mauriac requested a review from ajitbohra as a code owner April 3, 2022 13:15
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 3, 2022
@github-actions
Copy link

github-actions bot commented Apr 3, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @mauriac! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@gziolo gziolo added [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Block] Comment Template Affects the Comment Template Block [Type] Enhancement A suggestion for improvement. and removed [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop labels Apr 4, 2022
@cbravobernal cbravobernal self-requested a review April 4, 2022 07:23
@cbravobernal
Copy link
Contributor

Thanks for your contribution!! It's an amazing work 🎉

Test Report: Unify comments link markup

Env:

  • Localhost: wp-env
  • Browser: Chrome
  • WordPress: latest trunk
  • Gutenberg: latest trunk and without the plugin activated
  • OS: macOS Monterey

Steps to reproduce:

  • Go to Posts > Add New
  • Add 3 comments to the post
  • Add a Comments Query Loop Block.
  • Enable comment pagination so we can have an older and newer comments link. (3 comments, 1 comment per page).
  • Tested with both order options, last and first page as default.

Before applying the PR on the default page:

  • Comment pagination number link of the first/last page is different than the first/last page written link. ❌
    number_3_link
    newer_comments_link

Able to reproduce the issue ✅

After applying the PR:

  • Comment pagination number link of the first/last page is the same as the first/last page written link. ✅
    number_3_link_after_pr
    newer_comments_link_after_pr

Findings

  • Able to reproduce the issue ✅
  • Confirm the PR resolves the issue ✅

Questions

  • Is setting the cpage the best solution in this case? It is true that it does not modify any core function which is fine. It would be great to have some feedback.
  • Could be interfering with this bug fix? Both unit test and e2e are passing, but I'm guessing if we are adding some overload here.

cc: @hellofromtonya @ironprogrammer , maybe can give us a more experienced view.

@hellofromtonya
Copy link
Contributor

Is setting the cpage the best solution in this case? It is true that it does not modify any core function which is fine. It would be great to have some feedback.

If the goal is to make each number have it corresponding cpage in their respective link, then I'd suggest doing that work within the Core functions. Why? To unify the experience across block and classic; for consistency; to decrease efforts to maintain code (spreading out where cpage is touched makes it harder to maintain the code).

Core handles the paginated links. If there's a bug or block-specific need, I'd suggest working within the Core functions to make them work across all needs.

@mauriac
Copy link
Member Author

mauriac commented Apr 14, 2022

Thanks for reviewing @c4rl0sbr4v0 and @hellofromtonya. I was wondering if the core wasn't the best place to fix the bug, but since it's Gutenberg ticket I assumed that Gutenberg is the best location to fix it... I could have followed my first thought...

Well then, so next, I'll open a ticket into core trac and fix the bug over there... any objection? Or any other thoughts?

Thanks.

@cbravobernal
Copy link
Contributor

Well then, so next, I'll open a ticket into core trac and fix the bug over there... any objection? Or any other thoughts?

Not on my side. Opening a ticket into core with the fix seems to be the best solution. We can close this PR then. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Comment Template Affects the Comment Template Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments Pagination Block: Unify the markup on all pagination blocks rendering on PHP

4 participants