PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar vicn1222
vicn1222
17 Oct 2023

Pull Request for Issue #42123 .

Summary of Changes

This change is to fix Joomla router unable to parse custom SEF url. The SEF url has a rewrite rule defined in .htaccess. where the SEF url need to be converted to dynamic url with query string.

The affected function is Uri::getInstance() in libraries/src/Uri directory.

Testing Instructions

  1. create an article "foo-article" and a menu "foo-menu". The "foo-menu" will accept query string, such as

q=xyz&dir=abc&name=ijk

  1. The browser url will look like http://localhost/foo-menu/xyz/abc/ijk.html

  2. In .htaccess, add re-write rule below

RewriteRule ^foo-menu/(.)/(.)/(.*).html$ index.php/foo-menu?q=$1&dir=$2&name=$3 [NC,L]

  1. According to the .htaccess, the browser url needs be converted to

http://localhost/foo-menu?q=xyz&dir=abc&name=ijk

  1. The new url can then be passed into the Joomla router for menu entry lookup, resulting in correct parameters being sent to the menu for further processing.

Actual result BEFORE applying this Pull Request

The .htaccess rewrite rule is not applied prior to calling Joomla's router. A custom router is required.

Expected result AFTER applying this Pull Request

The rewrite rule in the ,htaccess is the custom router, dynamic url is generated before calling Joomla router. No extra custom router is needed.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • [x ] No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • [ x] No documentation changes for manual.joomla.org needed

Code changes

Code changes have been uploaded as "Uri.txt" in the issue tracker at https://issues.joomla.org/tracker/joomla-cms/42123

avatar vicn1222 vicn1222 - open - 17 Oct 2023
avatar vicn1222 vicn1222 - change - 17 Oct 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2023
Category Libraries
avatar vicn1222 vicn1222 - change - 17 Oct 2023
Labels Added: PR-4.4-dev
avatar vicn1222
vicn1222 - comment - 17 Oct 2023

Tests have been done in J3 & J4 multiple times. I am just unsure if I made the right pull request. This is the first time I am using github. So please correct me if there is any error in the pull request. I have been using svn all the time.

The change should also be applied to J3 if there is any possibility.

Thank you for the wonderful project!

-Frank

avatar Quy
Quy - comment - 18 Oct 2023

@vicn1222 Welcome! Thank you for your contribution.

FYI: To see drone issues, please go to the bottom of the page. Click Details. Click phpcs to see the issues to fix.

drone

avatar vicn1222
vicn1222 - comment - 18 Oct 2023

Failure was due to "else if". It should be "elseif"...

Look like this checkin is going to 4.4-dev. Will it automatically propagates to later version, such as 5.x?

I am totally new to github...

avatar vicn1222
vicn1222 - comment - 18 Oct 2023

Merged.

avatar vicn1222 vicn1222 - close - 18 Oct 2023
avatar vicn1222 vicn1222 - change - 18 Oct 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-10-18 09:58:05
Closed_By vicn1222

Add a Comment

Login with GitHub to post a comment