No Code Attached Yet
avatar Gratia-Mira
Gratia-Mira
26 Jan 2022

Steps to reproduce the issue

  1. install last fix from GitHub (#36733)
  2. arrange a redirection in the redirect pugin
  3. retrieve it and set any parameter
  4. repeat it with another parameter
  5. check the input in the redirect plugin

Expected result

the entry for new Url in the plugin value was not changed

Actual result

All parameters were added to the entry. Ugly urls are created

System information (as much as possible)

Newest Joomla 4.0.6

Additional comments

The solution
plugins\system\redirect\redirect.php
change the lines 225 and the following lines as follows:

$oldUrlParts = parse_url($redirect->old_url);
$newUrlParts = parse_url($redirect->new_url);

if ($urlQuery !== '' && empty($oldUrlParts['query']) && empty($newUrlParts['query']))
{
$newUrl = $redirect->new_url . '?' . $urlQuery;
} else {
$newUrl = $redirect->new_url;
}

$dest = Uri::isInternal($newUrl) || strpos($newUrl, 'http') === false ?
Route::_($newUrl) : $newUrl;
avatar Gratia-Mira Gratia-Mira - open - 26 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Jan 2022
avatar Gratia-Mira Gratia-Mira - change - 26 Jan 2022
The description was changed
avatar Gratia-Mira Gratia-Mira - edited - 26 Jan 2022
avatar Gratia-Mira Gratia-Mira - change - 26 Jan 2022
The description was changed
avatar Gratia-Mira Gratia-Mira - edited - 26 Jan 2022
avatar richard67
richard67 - comment - 26 Jan 2022

How do you know so sure that it is a bug so you add „Bug“ to the title? Does it work differently in Joomla 3?

A bug is when a software behaves in a way not intended by the programmer. It is not necessarily a bug when it does not behave like some users want.

You should leave it to us to classify if it is a bug or not.

avatar Gratia-Mira
Gratia-Mira - comment - 26 Jan 2022

Sorry, but I really got scared when I realized that my entries were overwritten. I was first afraid that I was hacked and then realized that it was related to the latest update of Joomla. For me, it resulted in 100 "server errors" on Google Search Console. Is not great and was certainly not the goal of the programmer.

Thanks but for the great work of Joomla! I will not write more bug next time!

Probably now not only the counter is updated, but also the adjusted newUrl.

avatar richard67
richard67 - comment - 26 Jan 2022

Hmm you could be right and it was introduced with the last release with the feature to always incremental the hits counter with every 404.

avatar richard67
richard67 - comment - 26 Jan 2022

For reference: The change was introduced with PR #34640 .

@tonypartridge Could you check if your PR could have caused this issue? Thanks in advance.

avatar tonypartridge
tonypartridge - comment - 26 Jan 2022

I'll check the issue out. But it has nothing to do with that PR directly since that just does a DB count update.

For reference: The change was introduced with PR #34640 .

@tonypartridge Could you check if your PR could have caused this issue? Thanks in advance.

avatar richard67
richard67 - comment - 26 Jan 2022

@tonypartridge It writes the complete object and not just the hits count, so that could be the problem, but maybe I am missing something.

avatar tonypartridge
tonypartridge - comment - 27 Jan 2022

You are correct, but it's due to poor previous logic. I'll create a PR. Thanks for your issues @Gratia-Mira

avatar richard67
richard67 - comment - 27 Jan 2022

You are correct, but it's due to poor previous logic.

@tonypartridge Yeah, that was what I expected, I did not think your PR broke something, only that it may have unmasked an older issue.

avatar tonypartridge
tonypartridge - comment - 27 Jan 2022

Don’t know how it’s been missed this long tbh! Directly changing the new
value which should never be changed unless done by a user in the admin.

On Thu, 27 Jan 2022 at 14:24, Richard Fath @.***> wrote:

You are correct, but it's due to poor previous logic.

@tonypartridge https://github.com/tonypartridge Yeah, that was what I
expected, I did not think your PR broke something, only that it may have
unmasked an older issue.


Reply to this email directly, view it on GitHub
#36862 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKWBFUKNOVS3BRW3C3UF3LUYFIRHANCNFSM5M4DZLIQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
Tony Partridge
Xtech Web Services Ltd

Managing Director/Developer

avatar Gratia-Mira
Gratia-Mira - comment - 27 Jan 2022

@tonypartridge Thanks back for your work!

avatar richard67 richard67 - change - 27 Jan 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-01-27 18:37:34
Closed_By richard67
avatar richard67 richard67 - close - 27 Jan 2022
avatar richard67
richard67 - comment - 27 Jan 2022

Closing as having a pull request. Please test #36873 . Thanks in advance.

avatar Gratia-Mira
Gratia-Mira - comment - 19 Feb 2022

I had the same error after updating to Joomla 4.1! Was the error not fixed?

avatar tonypartridge
tonypartridge - comment - 19 Feb 2022

I think it missed that release

Add a Comment

Login with GitHub to post a comment