-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Modern Routing] make a simpler loop in StandardRules::build #19012
[Modern Routing] make a simpler loop in StandardRules::build #19012
Conversation
this is be done by applying PR or manually? |
Manually, To create a test example (in order to not install a separate component) I created a custom configuration for For such custom configuration, the link to the top category should look like You do not need to click on that link because it has not work yet (parse method has not support such custom configuration yet) and returns error 404. I would like to leave it for another PR. For this PR I would like to change the loop to simpler and remove PHP notice. @joomdonation As you are familiar with |
@csthomas this is above my skills. |
But thanks for interest:) |
I have tested this item ✅ successfully on bf28ce6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19012. |
|
||
if ($found) | ||
if ($found === false && $item && $item->query['view'] === $element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think $item check is not needed here as we check and make sure it is not null in previous code already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@csthomas I think for this PR you should focus in make a simpler loop in StandardRules::build task only. That part is good and easier to understand compare to the original code. It will help testers easier to review the change and also easier for maintainer to review and merge. For adding support for new router configuration, I would leave it for the next PR as I am unsure if it needed for now (and as you mentioned, the generated link causes 404 error anyway). The routing code is quite complex, so I prefer small step at a time. |
Ok. When I have more time to think about it I will fix it. |
I close it in favour of #19271 |
Summary of Changes
Replace the old complex loop with a simpler one.
Remove PHP notice.
Everything should work as before.
This PR adds a way to build correct URL for below structure:
Testing Instructions
Install Joomla with sample data testing.
After you replace php code in
com_content/router.php
as describer above:index.php/component/content/categories/
and compare link to category view before and after patch.Expected result
No PHP notices.
Link to the top category view should be like
/featured-articles/14-sample-data-articles
Actual result
There is a
PHP Notice: Undefined index id on line 265
.Documentation Changes Required
No