You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the paginator object is created, the method setNormalizeOutOfRangePages(true) is called arbitrary.
When this normalizeOutOfRangePages is set to true, it allows the pagination to accept any page number, even if it out of range, without raising errors. Internally, the pager calculates the last page number and use it for the rendering.
For example, you have 50 items, with a pagination of 10 per page. The maximum page that you could use is 5.
With this parameter set to true, you can pass page=6 and do not have any error raised by the paginator.
In a context of an admin list, honestly, it not an important issue. But the grid system is also used in front (Product listing) and in this context, it caused a problem on an SEO side. The fact that any page can be used without triggering the not found error can lead to duplicate content of the last page of the list.
Solution
This method call seems to be here since the first commit of the pager system into the grid bundle (8 years).
I didn't find any reasons why it was implemented a first. So we have 2 possibilities, remove it or add a parameter to disable it globally or by route.
I can push a PR, let me know what to do
The text was updated successfully, but these errors were encountered:
Problem
When the paginator object is created, the method
setNormalizeOutOfRangePages(true)
is called arbitrary.When this
normalizeOutOfRangePages
is set to true, it allows the pagination to accept any page number, even if it out of range, without raising errors. Internally, the pager calculates the last page number and use it for the rendering.For example, you have 50 items, with a pagination of 10 per page. The maximum page that you could use is 5.
With this parameter set to true, you can pass page=6 and do not have any error raised by the paginator.
In a context of an admin list, honestly, it not an important issue. But the grid system is also used in front (Product listing) and in this context, it caused a problem on an SEO side. The fact that any page can be used without triggering the not found error can lead to duplicate content of the last page of the list.
Solution
This method call seems to be here since the first commit of the pager system into the grid bundle (8 years).
I didn't find any reasons why it was implemented a first. So we have 2 possibilities, remove it or add a parameter to disable it globally or by route.
I can push a PR, let me know what to do
The text was updated successfully, but these errors were encountered: