joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Definetively resolve single tag redirect on multilanguage site

Open queengab opened this issue 10 years ago • 24 comments

Hi to all,

i would like to point out for the last time the problem with joomla and single tag page. I saw around the web some solutions but there isn't a definitive solution. On joomla 3.3.6 i bypass it but now (i'm using 3.4.0) i can reproduce the error in the same way and i'd like to find a solution to update definetely. I used a clean 3.4.0 version for this site. No updating, no migration.

I create a menu item inside a hidden menu that list all of my tags with precise language (italian in this case) and created two tags inside an article.

I can view the main page of tags (index.php?option=com_tags&view=tags&tag_list_language_filter=it-IT&lang=ita) that show me tha actual tag. If i click the single tag i have a 1054 error and the url is the following: (index.php?option=com_tags&view=tag&id=2-articletitle&lang=ita)

If i enable sef url the single tag have this url (ita/component/tags/tag/2-articletitle.html) but is redirected to (ita/tags/2-articletitle)

if instead i use this url (ita/tag/tags/2-articletitle)that is the right seo url! ... the cms redirect to index.

I didn't find anything about this issue. Is there someone who can help me?

I dont' know if the problem is related to language or about the assignement of tamplate.

I tried to use the file components/com_tags/helpers/route.php on hackwar branch, nut nothing happens...

Thanks very much Gabriele

queengab avatar Apr 07 '15 12:04 queengab

Update to joomla 3.4.1 but nothing happens

queengab avatar Apr 07 '15 13:04 queengab

Hi Gab, What you discovered it's just one of the funny-funny bugs core joomla has in routings links. I resolved the problem in that way, but I doutb it's "definitively" solved. It's just a work around.

In file /com_tags/router.php

go to line 148 and comment the line, than replace next lines as following:

$id = explode(':',$segments[1]); if(empty($id[0])){ $id = explode(':',$segments[0]); $vars['id'] = $id ; $vars['view'] = 'tag'; return $vars; } $vars['id'] = $id[0] ; $vars['view'] = 'tag'; return $vars;

The fact is that the components cannot really parse the id query->id when the $item is setted but the ['id'] is not contained inside the query.

Let's try this solution.

I will very apreciated if somebody can help us to well understand how to write a smarter public function parse(&$segments) function.

Good bye.

CM

carmeloMagna avatar Apr 07 '15 15:04 carmeloMagna

Oh yeah! Works like a charm! Thnak you very much!!!

I hope this is a good solution but we need a function that can handle this problem definetely. I don't know if someone of the joomla development staff is working on this issue on joomla future versions.

We will waiting for response, but thanks very much for the moment! You have saved a lot of time to hundreds people!

Bye Gabriele

queengab avatar Apr 07 '15 17:04 queengab

I don't know if someone of the joomla development staff is working on this issue on joomla future versions.

I think it's @Hackwar

ghost avatar Apr 08 '15 10:04 ghost

@carmeloMagna can you make a PR?

infograf768 avatar Apr 08 '15 16:04 infograf768

That is not a solution to the underlying problem and will not work for everybody. I have looked into this issue and it is not fun to get this to work correctly, especially since several people expect the tagging to do several different things, which the current solution all fullfills, but only half way. Anyway, I will try to look into this for 3.5. I wont introduce this in 3.4.x

Hackwar avatar Apr 08 '15 17:04 Hackwar

Hello everybody,

and thank you for your reply. I well understand that mine it's not a solution.

I posted here because for the specific problem @queengab the hack works. Obviously the routing file is not so "pure" as everibody expect. Indeed, the page redirection goes to /ita/tags/mytag.html and not to /ita/tags/tag/mytag.html... in my simple site the solution is good enought to avoid any "404" or blanck page, but, of course, fix the code is not so "fun", as @Hackwar already said.

Yesterday I also noted that if you want to show the tag title in page /ita/tags/mytag.html you also find a duplicated title (ie. mytag mytag)

The problem is in file /components/com_tags/views/tag/view.html.php in the function getTagsTitle() @line 290

I fixed it with this (very stupid!!) control: if(count($tags_title) > 1 && $tags_title[0] == $tags_title[1] ){ return $tags_title[1]; }else{ return implode(' ', $tags_title); }

So, my intent is just to focus into the problem, hope I could be usefull in some manner.

Thank you

CM

carmeloMagna avatar Apr 09 '15 09:04 carmeloMagna

@hackwar did you address this in your router rewrite or is it still to be worked on?


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

brianteeman avatar May 08 '16 09:05 brianteeman

@hackwar any comment?


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

brianteeman avatar Jun 07 '16 10:06 brianteeman

I did not work on the tags component

Hackwar avatar Jun 07 '16 10:06 Hackwar

Hi to all,

after 3 years i post again on this topic. Recently i updated my joomla version to 3.8.6 fopr two websites.

Well i have gain the same problem with tag routing:

With sef enabled https://www.mysite.it/it/component/tags/tag/mytag.html redirect to https://www.mysite.it/it/tags/35-mytag

Have a generic error with browser

"This page is not redirected to the topic Firefox has detected that the server is redirecting the request for this page so that it can never be satisfied. This problem is often caused by blocking or refusing cookies."

With sef disabled http://www.mysite.it/index.php?option=com_tags&view=tag&id=1049:my-tag-blabla&lang=it redirect to http://www.mysite.it/index.php?lang=it

No error but redirect to home page

What happens? Tried to change the file /components/com_tags/router.php following https://github.com/joomla/joomla-cms/pull/18407, but nothing!

Bye

queengab avatar Apr 03 '18 14:04 queengab

@Hackwar I want to call you one more time, is this something that should be fixed with the new router or is it unrelated?


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

roland-d avatar Jul 22 '18 19:07 roland-d

@roland-d as i understand @Hackwar 's Comment above "I did not work on the tags component" its unrelated.


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

ghost avatar Aug 02 '18 11:08 ghost

Issue confirmed.

After you create a menuitem for the tag you still get /component/tags/tag/tag-name when you click on article and scrool down to the tag.

What are your steps to reproduce /tags/tagname instead of /component/tags/tag/tag-name ?

ghost avatar Oct 17 '18 06:10 ghost

@franz-wohlkoenig please delete the spam and block the user

brianteeman avatar Jun 14 '19 10:06 brianteeman

~~can't block user, please do one have the privilieges.~~ done

ghost avatar Jun 14 '19 10:06 ghost

Hi to all, @roland-d @carmeloMagna @queengab

after 5 years post again on this topic. Recently i updated my joomla version to 3.9.15

Well the same problem with tag routing

ghost avatar Feb 20 '20 13:02 ghost

Please block and remove these posts AND dont forget to delete the files from the issue tracker server

brianteeman avatar Feb 21 '22 09:02 brianteeman

Deleted the posts and requested to delete the files too. Thanks.

zero-24 avatar Feb 21 '22 16:02 zero-24

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

I have spent quite some time today reviewing this in Joomla 4 and as this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4. cc @zero-24

brianteeman avatar Aug 26 '22 12:08 brianteeman

This is still a valid issue. We still need to fix this in 4.x

Hackwar avatar Aug 26 '22 13:08 Hackwar

@Hackwar are you sure? I was unable to replicate the reported problem. I didnt just blindly close it

brianteeman avatar Aug 26 '22 13:08 brianteeman

I just looked at the 4.2-dev branch and the tags router there is still the same crap it has been since Joomla 3.2. It is broken in loads of places and still needs a complete rewrite. To be honest, it is such a clusterfuck that I'm pushing that away for years now. Mea culpa. I swear, I'll get to that before 4.4 is released.

Hackwar avatar Aug 26 '22 13:08 Hackwar

Maybe I did something different which is why I couldnt replicate it?

https://user-images.githubusercontent.com/1296369/186915882-929c330b-761c-4ae3-ade4-222f69c5b2d6.mp4

brianteeman avatar Aug 26 '22 13:08 brianteeman

#39140 should fix this, so I'm closing this one.

Hackwar avatar Nov 03 '22 09:11 Hackwar

Just 7 short years. Yeay! 😉

Hackwar avatar Nov 03 '22 09:11 Hackwar