User tests: Successful: Unsuccessful:
Pull Request to improve #19397
view from SEF link generated by mod_articles_archive.index.php/en/archived-articles/2013/10?view=archiveindex.php/en/archived-articles/2013/10/0/0 from second and next pages, when no year, nor month have been selected.index.php/en/archived-articles/0/0?view=archive&start=5index.php/en/archived-articles?start=5index.php/en/archived-articles/2011/0?view=archive - worksindex.php/en/archived-articles/2011 - error 404 or display article with id 2011index.php/en/archived-articles/2011 - worksindex.php/archived-articlesJoomla generate and parse nicer links, old links still works.
Joomla adds redundant parameters and segments to SEF link.
No
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End com_content |
| Labels |
Added:
?
|
||
Fixed.
Please confirm that this is the expected behavior with different URLs to the same pages.
Link in the Archived Articles module.
http://localhost/joomla-cms-staging/en/archived-articles/2011/1
pagination: http://localhost/joomla-cms-staging/en/archived-articles/2011/1?start=5
Using the archive filter form:
http://localhost/joomla-cms-staging/en/archived-articles?month=1&year=2011&limitstart=0
http://localhost/joomla-cms-staging/en/archived-articles?month=1&year=2011&start=5
Currently yes. Staging has the same.
This happen after the second commit but the real problem is probably somewhere else.
I have tested this item
I found a place in code where I can fix it but I won't add it to this PR.
This PR is ready to test.
Please provide an example for the last commit.
When SEF is ON go to page like index.php?option=com_content&view=archive&Itemid=256&lang=en&month=0 (adjust to your Itemid for index.php/en/archived-articles)
Then check URL for the page 2.
Before: index.php/en/archived-articles?month=0&start=5
After: index.php/en/archived-articles?start=5
At the moment, it's a bit pedantic, but when I fix below issue
Using the archive filter form:
http://localhost/joomla-cms-staging/en/archived-articles?month=1&year=2011&limitstart=0
http://localhost/joomla-cms-staging/en/archived-articles?month=1&year=2011&start=5
it will be more useful.
I still get this index.php/en/archived-articles?month=0&start=5 with/without the PR.
Please follow instruction.
The last commit hide parameter month=0 in a next page link when you are first time of non SEF URL.
The link is not SEF but your joomla has SEF enabled and limit field value 5 is saved in session.
index.php/en/archived-articles and set limit to 5.index.php?option=com_content&view=archive&Itemid=256&lang=en&month=0, which is equivalent of index.php/en/archived-articles.index.php/en/archived-articles?month=0&start=5index.php/en/archived-articles?start=5Additional, if you apply below patch (I'm still working on it):
diff --git a/libraries/src/Router/SiteRouter.php b/libraries/src/Router/SiteRouter.php
index 6dbabc1ea0..35b5dfa881 100644
--- a/libraries/src/Router/SiteRouter.php
+++ b/libraries/src/Router/SiteRouter.php
@@ -404,6 +404,9 @@ class SiteRouter extends Router
}
}
+ // Set the information in the request
+ $vars = array_merge($found->query, $vars);
+
$vars['Itemid'] = $found->id;
$vars['option'] = $found->component;
}
@@ -441,14 +444,6 @@ class SiteRouter extends Router
$route = implode('/', $segments);
}
- else
- {
- // Set active menu item
- if ($item = $this->menu->getActive())
- {
- $vars = $item->query;
- }
- }
$uri->setPath($route);
then this will affect SEF links and after you click on filter you should never see parameters &month=0&year=0 on page links.
I have tested this item
I have tested this item
| Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
It would be nice to add this PR to 3.8.4 milestone because this PR could be treated as regression.
Example:
index.php/en/archived-articles/2011 returns error 404 on staging but works in 3.8.3 and in this PR.
I'm wrong. I did not remember correctly the comment from #19397 (comment).
I did a simple test.
At 3.8.3:
Go to archive view (index.php/en/archived-articles) and set Month to Jan and limit to 5.
The filter, next go to the second page (index.php/en/archived-articles?month=1&year=0&start=5)
After that go to third page (index.php/en/archived-articles?month=1&year=0&start=10)
Success. You are on 3rd page.
At staging:
Go to archive view (index.php/en/archived-articles) and set Month to Jan and limit to 5.
The filter, next go to the second page (index.php/en/archived-articles/0/1?view=archive&start=5)
After that go to third page, it is broken (index.php/en/archived-articles?id=1&start=10)
Failed. You can not get to page 3.
At this PR:
Go to archive view (index.php/en/archived-articles) and set Month to Jan and limit to 5.
The filter, next go to the second page (index.php/en/archived-articles?month=1&year=0&start=5)
After that go to third page (index.php/en/archived-articles?month=1&year=0&start=10)
Success. You are on 3rd page.
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-27 16:27:20 |
| Closed_By | ⇒ | mbabker | |
| Labels |
Added:
?
|
||
Getting these;
Undefined index: view in \components\com_content\helpers\legacyrouter.php on line 99