Feature RTC PR-5.3-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar Hackwar
Hackwar
28 Aug 2024

Summary of Changes

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.

Testing Instructions

  1. You need at least one article which is not directly linked to by a menu item.
  2. Edit an article and insert a link like 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.
  3. Check out the link in the frontend by visiting the article.

Actual result BEFORE applying this Pull Request

You get a strange link, for example something like /menuitem?view=article&id=42

Expected result AFTER applying this Pull Request

You get the correct link, for example /menuitem/this-test-is-successfull

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

avatar Hackwar Hackwar - open - 28 Aug 2024
avatar Hackwar Hackwar - change - 28 Aug 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2024
Category Front End com_contact com_content com_newsfeeds Libraries
avatar Hackwar Hackwar - change - 28 Aug 2024
Labels Added: PR-5.2-dev
avatar dautrich dautrich - test_item - 28 Aug 2024 - Tested unsuccessfully
avatar dautrich
dautrich - comment - 28 Aug 2024

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.

avatar dautrich
dautrich - comment - 28 Aug 2024

My test wasn't successful. Here the screenshots:

Before applying the patch
Before_linking_article
Before_linked_article

After applying the patch
After_linking_article
After_linked_article

avatar Hackwar
Hackwar - comment - 28 Aug 2024

As this PR is against 5.2, you have to also test this on 5.2-dev and not 5.1.

avatar Hackwar
Hackwar - comment - 28 Aug 2024

When you link the category of the article in a menu item, you should have successfull tests.

avatar Hackwar
Hackwar - comment - 28 Aug 2024

Since we are in feature freeze, I'm going to change the target of this PR to 5.3-dev.

avatar Hackwar Hackwar - change - 28 Aug 2024
Title
[5.2] SEF: Fix URLs when preprocessing
[5.3] SEF: Fix URLs when preprocessing
avatar Hackwar Hackwar - edited - 28 Aug 2024
avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2024
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
avatar dautrich
dautrich - comment - 28 Aug 2024

As this PR is against 5.2, you have to also test this on 5.2-dev and not 5.1.

@Hackwar Can I use 5.2beta1 or do I need a nightly build?

avatar dautrich
dautrich - comment - 28 Aug 2024

When you link the category of the article in a menu item, you should have successfull tests.

@Hackwar ???

avatar richard67
richard67 - comment - 28 Aug 2024

@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.
avatar Hackwar
Hackwar - comment - 28 Aug 2024

@dautrich beta1 should be enough.

@richard67 I'm aware. The tests are broken, since they are saving the contact with a broken catid.

avatar Hackwar Hackwar - change - 28 Aug 2024
Labels Added: Feature Language Change PR-5.3-dev
Removed: PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2024
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
avatar Hackwar Hackwar - change - 29 Aug 2024
Labels Removed: Language Change
avatar dautrich dautrich - test_item - 31 Aug 2024 - Tested successfully
avatar dautrich
dautrich - comment - 31 Aug 2024

I have tested this item ✅ successfully on c57d285


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

Tested on naked 5.2.0-beta1, local with Laragon.

avatar joomla-cms-bot joomla-cms-bot - change - 12 Sep 2024
Category Front End com_contact com_content com_newsfeeds Libraries Front End com_contact com_content com_newsfeeds Libraries JavaScript Unit Tests
avatar Elfangor93
Elfangor93 - comment - 30 Sep 2024

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

avatar Elfangor93 Elfangor93 - test_item - 30 Sep 2024 - Tested successfully
avatar Elfangor93
Elfangor93 - comment - 30 Sep 2024

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.


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

avatar SniperSister SniperSister - test_item - 4 Oct 2024 - Tested successfully
avatar SniperSister
SniperSister - comment - 4 Oct 2024

I have tested this item ✅ successfully on 894383e


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

avatar alikon alikon - change - 4 Oct 2024
Status Pending Ready to Commit
avatar alikon
alikon - comment - 4 Oct 2024

RTC


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

avatar rdeutz rdeutz - change - 17 Oct 2024
Labels Added: RTC Unit/System Tests
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2024
Category Front End com_contact com_content com_newsfeeds Libraries JavaScript Unit Tests Front End com_contact com_content com_newsfeeds Libraries
avatar Quy Quy - change - 17 Oct 2024
Labels Removed: Unit/System Tests
avatar rdeutz rdeutz - change - 29 Oct 2024
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
avatar rdeutz rdeutz - close - 29 Oct 2024
avatar rdeutz rdeutz - merge - 29 Oct 2024
avatar rdeutz
rdeutz - comment - 29 Oct 2024

Thanks to all who have worked on this PR.

Add a Comment

Login with GitHub to post a comment