Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.4] Fix start=0 in the pagination #44069

Open
wants to merge 2 commits into
base: 4.4-dev
Choose a base branch
from

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Sep 13, 2024

Pull Request for Issue #44049 .

Summary of Changes

Fix removing of start=0 from pagination for the first page.

Testing Instructions

Visit Category Blog or another list view with pagination.
Visit second page, and check the link for first page.

Actual result BEFORE applying this Pull Request

Link contain start=0

Expected result AFTER applying this Pull Request

Link without start=0

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed

@Mich-es
Copy link

Mich-es commented Sep 13, 2024

It works!

@fgsw
Copy link

fgsw commented Sep 13, 2024

@Mich-es can you open https://issues.joomla.org/tracker/joomla-cms/44069 and click button "Tested successfully" so the test is counted.

@ChristineWk
Copy link

I have tested this item ✅ successfully on 44c8277


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

1 similar comment
@Mich-es
Copy link

Mich-es commented Sep 13, 2024

I have tested this item ✅ successfully on 44c8277


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 13, 2024
@PhocaCz
Copy link
Contributor

PhocaCz commented Sep 13, 2024

On some places, I get '0'

image

So, for me, instead of:

if ($limitstart !== null && $limitstart !== '') {

this works:

if ($limitstart !== null && $limitstart !== '' && $limitstart !== '0') {

@Fedik
Copy link
Member Author

Fedik commented Sep 13, 2024

It is expected, when limitstart have a value, then it will be added to URL.
The router code is skipping only empty values.

@PhocaCz
Copy link
Contributor

PhocaCz commented Sep 13, 2024

I have tested this item ✅ successfully on 44c8277

Tested successfully with $hideEmptyLimitstart set to true. Thank you.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

@Fedik Fedik changed the title Fix start=0 in the pagination [4.4] Fix start=0 in the pagination Sep 13, 2024
@n3t
Copy link
Contributor

n3t commented Sep 15, 2024

I have tested this item ✅ successfully on 62b3a63


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

@n3t
Copy link
Contributor

n3t commented Sep 15, 2024

Just an idea, wouldn't be better to have $hideEmptyLimitstart true as default? I guess probably there are more components using pagination with hidden start=0 than those requireing this syntax...


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44069.

@universewrld
Copy link

To get rid of all the pagination duplicates, it is necessary for @joomla to have the rel="canonical" attribute for this type of page, indicating as a canonical page the version of the page without the ?start parameter.

@Fedik is it possible to add this to the current Issue?

as far as I know, there will be a solution for other types of duplicate pages in Joomla in Joomla 5.2, but there is no solution for the ?start parameter, which can be solved by adding a canonical link and then Joomla will be completely protected from all types of duplicate pages.

@Fedik
Copy link
Member Author

Fedik commented Sep 15, 2024

is it possible to add this to the current Issue?

Nope, it's not as simple as it might seem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PR-4.4-dev RTC This Pull Request is Ready To Commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On the start page /?start=0 works
10 participants