User tests: Successful: 0 Unsuccessful: 0
The routing in Joomla requires some information to be in the query to build proper URLs. One is the slug
, the combination of the ID and alias of a content item (for example &id=42:the-answer-to-everything
) and the other is the parent key, if the extension requires this. (for example &catid=21
) When this information is missing, the router can't build the right URL.
This PR adds a new component router rule, which should help fixing such URLs. The rule is supposed to be flexible enough to be used by most third party components. The parameters for the rule are the view configuration to act upon, the table to read the info from, the tables key and the tables parent key. The parent key is optional and the rule can be added more than once for different views.
index.php?option=com_content&view=article&id=<id>
where id
is the ID of the article which is NOT directly linked to by a menu item.You get a strange link, for example something like /menuitem?view=article&id=42
You get the correct link, for example /menuitem/this-test-is-successfull
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
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_contact com_content com_newsfeeds Libraries |
Labels |
Added:
PR-5.2-dev
|
As this PR is against 5.2, you have to also test this on 5.2-dev and not 5.1.
When you link the category of the article in a menu item, you should have successfull tests.
Since we are in feature freeze, I'm going to change the target of this PR to 5.3-dev.
Title |
|
Category | Front End com_contact com_content com_newsfeeds Libraries | ⇒ | Administration com_admin com_installer com_joomlaupdate com_templates Language & Strings Front End com_contact com_content com_finder com_newsfeeds com_tags Layout Libraries |
@Hackwar System tests are failing:
Running: site/components/com_contact/Category.cy.js (48 of 124)
Test in frontend that the contact category view
✓ can display a list of contacts in a menu item (1282ms)
✓ can display a list of contacts without a menu item (663ms)
1) "after each" hook for "can open the contact form in the default layout"
2 passing (5s)
1 failing
1) Test in frontend that the contact category view
"after each" hook for "can open the contact form in the default layout":
Error: Unwanted PHP Warning: " Undefined array key 1 in <b>/tests/www/cmysql/components/com_contact/src/Service/Router.php</b> on line <b>163</b>"
Because this error occurred during a `after each` hook we are skipping all of the remaining tests.
@dautrich beta1 should be enough.
@richard67 I'm aware. The tests are broken, since they are saving the contact with a broken catid.
Labels |
Added:
Feature
Language Change
PR-5.3-dev
Removed: PR-5.2-dev |
Category | Front End com_contact com_content com_newsfeeds Libraries Administration com_admin com_installer com_joomlaupdate com_templates Language & Strings com_finder com_tags Layout | ⇒ | Front End com_contact com_content com_newsfeeds Libraries |
Labels |
Removed:
Language Change
|
I have tested this item ✅ successfully on c57d285
Tested on naked 5.2.0-beta1, local with Laragon.
Category | Front End com_contact com_content com_newsfeeds Libraries | ⇒ | Front End com_contact com_content com_newsfeeds Libraries JavaScript Unit Tests |
When applying this PR using the patch tester component, the Link to the article as well as its URL changes from
SEF Plugin, Strict Routing: No
index.php/menuitem?view=article&id=2 (before this PR)
to
index.php/menuitem?view=article&id=2:autos&catid=2 (after this PR)
SEF Plugin, Strict Routing: Yes
index.php/component/content/article/autos (before this PR)
to
index.php/component/content/article/autos?catid=2 (after this PR)
Joomla v5.2.0-beta3
PHP v8.1.2
I have tested this item ✅ successfully on 894383e
See results of my test in the above comment. In consultation with the author of the PR the resulting behavior is as expected. Even if the case with activated strict routing in the SEF Plugin produces a bad result.
I have tested this item ✅ successfully on 894383e
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
RTC
Unit/System Tests
|
Category | Front End com_contact com_content com_newsfeeds Libraries JavaScript Unit Tests | ⇒ | Front End com_contact com_content com_newsfeeds Libraries |
Labels |
Removed:
Unit/System Tests
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-10-29 17:56:45 |
Closed_By | ⇒ | rdeutz |
Thanks to all who have worked on this PR.
I have tested this item ? unsuccessfully on da8002a
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992.