No Code Attached Yet bug
avatar Merl06
Merl06
9 Nov 2022

Steps to reproduce the issue

Good afternoon!

I use Joomla ‎4.2.4 (Multi-language) + Language filter (languagefilter) + standard SEF (I don't use anything third-party)

As a result, links of the form are generated: domain.ru/page.html and domain.ru/en/page.html
but if you go, by clicking on the language switcher, to the en version of the site - then back - then it redirects to a URL of the form

domain.ru/page?format=html (although, obviously, this URL does not appear anywhere)

I found out that this problem occurs if you enable the "Remove language code from URL" option in the language filter.

Expected result

Actual result

System information (as much as possible)

Additional comments

Votes

# of Users Experiencing Issue
6/6
Average Importance Score
4.83

avatar Merl06 Merl06 - open - 9 Nov 2022
avatar Merl06 Merl06 - change - 9 Nov 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 9 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Nov 2022
avatar snegicodes
snegicodes - comment - 17 Nov 2022

I would like to work on this issue, can you assign me this one please?


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

avatar bembelimen
bembelimen - comment - 17 Nov 2022

Just work on it and create a pull request when you have fixed it.

avatar Merl06
Merl06 - comment - 18 Nov 2022

I will be glad if you solve this problem. After all, it did not occur to me
alone, I just reported it.

чт, 17 нояб. 2022 г. в 19:50, Benjamin Trenkle @.***>:

Just work on it and create a pull request when you have fixed it.


Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPWUN5ENKDCI2ZPH3LDWIZV57ANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you authored the thread.Message ID:
@.***>

avatar drmenzelit
drmenzelit - comment - 19 Nov 2022

@Merl06 the comment from @bembelimen was related to the question from @snegicodes . We don't asign issues, if someone has an idea how to solve it, she/he can create a pull request.

avatar snegicodes
snegicodes - comment - 19 Nov 2022

@Merl06 Actually I am not facing the issue myself, so can you please provide me with the steps to reproduce the bug?

avatar Merl06
Merl06 - comment - 19 Nov 2022

install two languages, enable the "language filter" plugin and the
"language switching" module.
In the "language filter" plugin, enable the "Delete default language code"
option. the problem appears when you switch to a version of the material in
which the language is set to the default content language, instead of the
suffix appears "?format=html " the problem only appears if you click on the
language identifier, which is set by default in the "language switching"
module

сб, 19 нояб. 2022 г. в 19:12, Sarthak Negi @.***>:

@Merl06 https://github.com/Merl06 Actually I am not facing the issue
myself, so can you please provide me with the steps to reproduce the bug?


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

avatar Ltamann
Ltamann - comment - 3 Dec 2022

I tested overwriting mod_language.
By selection "remove language code from url" all our default language websites don't get the language tag /en/ or /xx/ in the url ! BUT the language switcher add that lang_code to the URL. This is causing a redirect from Joomla and the redirect adds the ?format=html.

avatar Ltamann
Ltamann - comment - 3 Dec 2022

The ?format=html is added by the ../plugins/system/languagefilter/languagefilter.php public function parseRule !

To test, copy the link with the code lang_your.domain.com/en/xxxxx.html directly into the browser and you will get the same result your.domain.com/xxxxx.?format=html.


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

avatar Ltamann
Ltamann - comment - 3 Dec 2022

For my proyect i do not like that internal sitelinks are redirected so to correct the wrong URL in the language switcher you can add this script to mod_language default.php. This seems to do the job.

The only thing to have in mind is that the prefix of your language has to be the standard prefix so for en_GB is has to be en! +
This only resoves the problem of the language menu not if some link contains the wrong lang_code!

Add it under each "php foreach ($list as $language)" :

$config =& JFactory::getConfig();
$defaultlang = substr($config->get( 'language' ), 0, 2);
if (!$language->link == '/'.$defaultlang.'/') {
if (substr($language->link, 0, 3) == '/'.$defaultlang) {
$language->link = substr($language->link, 3);
}
}

avatar Merl06
Merl06 - comment - 3 Dec 2022

I don't have the necessary experience and knowledge to fix this, so I'm
asking for help...

сб, 3 дек. 2022 г. в 13:37, Ltaman @.***>:

It's definitely a problem with the joombla redirect and not the language
switcher!

To test, copy the link with the code lang_your.domain.com/en/xxxxx.html
directly into the browser and you will get the same result
your.domain.com/xxxxx.?format=html.

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
issues.joomla.org/tracker/joomla-cms/39181.


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

avatar Ltamann
Ltamann - comment - 3 Dec 2022

Hi Merl06

  1. make a copy of yor page - use the copy for the test offline or online on a subdomain.
  2. make an override of mod_languages - there are many toturials online (https://www.joomlart.com/tutorials/joomla-4-tutorials-how-to-create-override-for-modules-components-and-layout)
  3. open and edit : your template/html/mod_languages/default.php
  4. enter my code under both < ? php foreach ($list as $language) : ?>
  5. the code has to be inside < ?php CODE ?>
    Test It
avatar Ltamann
Ltamann - comment - 3 Dec 2022

The ?format=html is added by the

../plugins/system/languagefilter/languagefilter.php
public function parseRule !

To get rid of it, until someone knows better fix it correctly,
you can add in line 450 below // Redirect to language.
this code:

$redirectUri = str_replace("?format=html", ".html", $redirectUri);

avatar Merl06
Merl06 - comment - 4 Dec 2022

Dear Ltaman, thank you for helping me solve this problem. I followed your
advice and did everything as you wrote, but I did not get the result,
unfortunately ....

сб, 3 дек. 2022 г. в 17:13, Ltaman @.***>:

Adding my code to mod_languages solves the multianguage menu but crawling
the side there are other url get requests with ?format=html.
Joomla docs is pointing to the SEF router:

https://docs.joomla.org/URLs_in_Joomla

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
issues.joomla.org/tracker/joomla-cms/39181.


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

avatar Ltamann
Ltamann - comment - 4 Dec 2022

Dear Merl06,

first try if you have the same ?format=html problem we are talking about.
Do the following:
Open a random page of your Site in your main language like: https://www.xxxx.com/myarticle.html
add your default language code to the url (if english=en): https://www.xxxx.com/en/myarticle.html
The page should open like this https://www.xxxx.com/myarticle?format=html

If this is happening than you can do this:
Check your Setting;

  1. For Joomla ‎4.2.5 tested
  2. Language filter (languagefilter) enable the "Remove language code from URL" in Language filter plugin
    Captura de pantalla 2022-12-04 084829
  3. My System ->Global Configuration SEO settings:
    image
  4. Set templetes default language, tested with es :
    image
  5. for any testing you have to disable all cache functions, if not you will see only the cached version of your site / if you use Jommla without thirtparty cache plugins turn off: System ->Global Configuration -> Server -> System Cache = OFF
  • turn off Plugin System-Page cache
  • clear the cache: Home Dashboard -> cache -> clear cache
  1. As first step change only this code in ../plugins/system/languagefilter/languagefilter.php add line 451
    image

test again: https://www.xxxx.com/en/myarticle.html should open like https://www.xxxx.com/myarticle.html

If not try to disabel all other thirtparty plugins and/or switch for testing to joombla standart template.

Keep in mind that the changes in ../plugins/system/languagefilter/languagefilter.php will by overwritten by any new joomla update.

So if you did this, I recommend trying to override mod_languages ​​because only this change is really fixing the bad links in the Change Language Menu..

avatar Merl06
Merl06 - comment - 4 Dec 2022

Dear Ltaman, thank you very much. Your advice with 451 lines works fine, I
think this fix will be useful for many Joomla users

вс, 4 дек. 2022 г. в 10:31, Ltaman @.***>:

Dear Merl06,

first try if you have the same ?format=html problem we are talking about.
Do the following:
Open a random page of your Site in your main language like:
https://www.xxxx.com/myarticle.html
add your default language code to the url (if english=en):
https://www.xxxx.com/en/myarticle.html
The page should open like this https://www.xxxx.com/myarticle?formalt=html

If this is happening than you can do this:
Check your Setting;

  1. For Joomla ‎4.2.5 tested
  2. Language filter (languagefilter) enable the "Remove language code
    from URL" in Language filter plugin
    [image: Captura de pantalla 2022-12-04 084829]
    https://user-images.githubusercontent.com/2974923/205480145-a8755fb0-dbaa-4213-911b-3c05c06a4f8d.png
  3. My System ->Global Configuration SEO settings:
    [image: image]
    https://user-images.githubusercontent.com/2974923/205481125-5b11716e-f629-4eb8-883e-78bf18632291.png
  4. Set templetes default language, tested with es :
    [image: image]
    https://user-images.githubusercontent.com/2974923/205480082-0d697d04-ac25-46b4-bf5d-3533f184aa90.png
  5. for any testing you have to disable all cache functions, if not you
    will see only the cached version of your site / if you use Jommla without
    thirtparty cache plugins turn off: System ->Global Configuration -> Server
    -> System Cache = OFF
  • clear the cache: Home Dashboard -> cache -> clear cache
  • turn off Plugin System-Page cache
  1. As first step change only this code in
    ../plugins/system/languagefilter/languagefilter.php add line 451
    [image: image]
    https://user-images.githubusercontent.com/2974923/205480212-d0a37806-df2f-461d-9e81-94c8b9bba292.png

test again: https://www.xxxx.com/en/myarticle.html should open like
https://www.xxxx.com/myarticle.html

If not try to disabel all other plugins thirtparty plugins and/or switch
for testing to joombla standart template.

Keep in mind that the changes in
../plugins/system/languagefilter/languagefilter.php will by overwritten by
any new joomla update.


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

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar ptdev
ptdev - comment - 19 Jul 2023

Hi,

This issue is still present on Joomla 4.3.3.

It's a small issue but really affects the consistency of a website's URL structure.

The fix posted above seems to be working but involves manually editing a core file which is not ideal.

Are there any predictions for an official fix?

avatar sergeytolkachyov
sergeytolkachyov - comment - 11 Aug 2023

I have had the same issue. But I disable a url suffix in global params and added this redirect to htaccess
RedirectMatch 301 "(.*)\.html$" "$1"
Then all of my pages transfered from site.ru/page.html to site.ru/page.

avatar Slava287
Slava287 - comment - 6 Nov 2023

Hi there is a solution for joomla 5? Then the above solution is not working


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

avatar capogr
capogr - comment - 20 Dec 2023

Big SEO problem with this one still no official fix?


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

avatar Hackwar
Hackwar - comment - 5 Feb 2024

I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?

avatar Slava287
Slava287 - comment - 5 Feb 2024

I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?
Since the problem was not solved and generated many new duplicates, I had to switch to a version without .html. Once I removed the suffix, the problem was solved.

avatar Slava287
Slava287 - comment - 5 Feb 2024

I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?

Since the problem was not solved and generated many new duplicates, I had to switch to a version without .html. Once I removed the suffix, the problem was solved.

avatar Hackwar Hackwar - change - 29 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-29 10:50:14
Closed_By Hackwar
avatar Hackwar Hackwar - close - 29 Mar 2024
avatar Hackwar
Hackwar - comment - 29 Mar 2024

Since I did not get any further feedback on this and I can't replicate this, I'm closing this one.

avatar mediaket
mediaket - comment - 3 Jun 2024

Hi there :)

The problem persists in joomla 5.1.0 and joomla 5.1.1. The solution provided here resolves the problem, but you have to repeat the same operation each time you update Joomla.

Thank you.

Screenshot:


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39181.
avatar Slava287
Slava287 - comment - 3 Jun 2024

Since I did not get any further feedback on this and I can't replicate this, I'm closing this one.

Hello. There is a website where this problem exists, how can I contact you?

avatar Hackwar
Hackwar - comment - 4 Jun 2024

Write me at info@joomlager.de

avatar Hackwar
Hackwar - comment - 4 Jun 2024

I was able to replicate this. Reopening the issue.

avatar Hackwar Hackwar - change - 4 Jun 2024
Status Closed New
Closed_Date 2024-03-29 10:50:14
Closed_By Hackwar
avatar Hackwar Hackwar - reopen - 4 Jun 2024
avatar Hackwar
Hackwar - comment - 5 Jun 2024

The problem is that the languagefilter plugin redirects the URL while parsing the URL instead of after being done with parsing. This results in the URL being partially decoded and the redirect being to that partial URL. The languagefilter plugin needs a bigger rewrite to fix this.

avatar Slava287
Slava287 - comment - 5 Jun 2024

Should we expect a solution in the near future? The problem has simply existed for a long time. Please also pay attention to the problem of tags, I created a topic. The problem is the most serious because it greatly affects SEO.

avatar Hackwar
Hackwar - comment - 5 Jun 2024

It depends. Either someone else picks this up or I have to find the time to work on this and to be honest, my volunteer time right now is rather limited. It might take until 5.3 to fix this.

avatar Slava287
Slava287 - comment - 5 Jun 2024

I understand you perfectly, thank you for your work!

avatar Hackwar Hackwar - close - 20 Aug 2024
avatar Hackwar
Hackwar - comment - 20 Aug 2024

Can you please check #43858? The PR is not perfect yet, but it should solve your issue in the longterm. As I wrote, it will probably be part of 5.3. It wont be ready in time for 5.2.

avatar Hackwar Hackwar - change - 20 Aug 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-08-20 08:43:14
Closed_By Hackwar
avatar cyb3rx
cyb3rx - comment - 7 Feb 2025

Hello!
I just encountered the same problem, exactly as described before me.
When is this expected to be resolved?
I see it has been going on for almost 3 years, is it really that big of a deal that it takes so long to resolve?

J5.2.2

Thx!


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

avatar fgsw
fgsw - comment - 7 Feb 2025

I see it has been going on for almost 3 years, is it really that big of a deal that it takes so long to resolve?

@cyb3rx The mentioned Pull Request #43858 hasn't the needed 2 successfully test so it can't be merged. You can help and test the Pull Request.

avatar cyb3rx
cyb3rx - comment - 7 Feb 2025

I see it has been going on for almost 3 years, is it really that big of a deal that it takes so long to resolve?

@cyb3rx The mentioned Pull Request #43858 hasn't the needed 2 successfully test so it can't be merged. You can help and test the Pull Request.

ok, what can I do?

avatar fgsw
fgsw - comment - 7 Feb 2025

ok, what can I do?

How i test

  • Created a free site by launch.joomla.org
  • update the installation with the prebuilt package of the Pull Request:

Image

  • read the Testing Instructions of the Pull Request

After successfully test

open https://issues.joomla.org/tracker/joomla-cms/43858 and

  • login with your github-account
  • click button "Test this"
  • mark "Tested successfully"

Now the test count as successfull.

Add a Comment

Login with GitHub to post a comment