?
avatar schnuti
schnuti
26 Aug 2015

Is a bug that survived all new version releases since Joomla 1.6 still a bug? ;)

The handling of links to archived articles is and was wrong.

Have a look at line in 213 in router.php
if (isset($query['year']) && isset($query['month']))
This line will never be true! See line 204 and 209
if (isset($query['year'])) ....

                unset($query['year']);

But the link created is wrong anyway.

I've tried to fix it, but came to the conclusion that I do not know what it's supposed to look like.
My guess is that a menu item should be created for Archived articles. This can be in a hidden menu.

The link and canonical link can then be
to-your-joomla/archived-articles-menu/year/month

What if there is no menu item for archived articles? Should it be
to-your-joomla/any-content-menu?view=archive&year=xxxx&month=yy

What is here the any-content-menu? Canonical?

You can test (e.g. Joomla with blog example data.)

  • Set SEO to on in the configuration. Well - maybe first test without SEO!
  • Set some article(s) to archived
  • In an Archived articles module -> check the link(s)
  • (Alternative -> use the standard search to look up any archived article -> check the links)
  • Repeat the test with an activated Archived articles menu item Note! The blog example data has NO Menu item for Archived articles.

I need some hints. I'm not that fit in router theory.

avatar schnuti schnuti - open - 26 Aug 2015
avatar zero-24 zero-24 - change - 26 Aug 2015
Labels Added: ?
avatar zero-24
zero-24 - comment - 26 Aug 2015

Maybe @Hackwar can explain the theory behind the router?

But i can remember that we have some more issues with the archives view. But i cant find the github issue atm.

avatar schnuti
schnuti - comment - 26 Aug 2015

@zero-24
Thanks! Can you confirm the bug? or is it enough to see the code?
BTW I have solved the links with a created Archived aricles menu item. Becomes as my suggestion
to-your-joomla/archived-articles-menu/year/month


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

avatar schnuti
schnuti - comment - 26 Aug 2015

@zero-24
I now made a search and found some related issues.
I found this bug as I commented on the related issue 7084.

As I found the basic bug in the code - it's time to solve it, isn't it?

avatar zero-24 zero-24 - change - 26 Aug 2015
Category Router / SEF
avatar zero-24
zero-24 - comment - 26 Aug 2015

Just get it the Issue i mean is: #5810

avatar zero-24 zero-24 - reference | fa19566 - 26 Aug 15
avatar schnuti
schnuti - comment - 26 Aug 2015

I had a look at #5810

I agree! Do not add functionality to the Archived articles view.
Quote: "by making the archive view more attractive"
The suggested addition of categories would probably make the SEO links fail completely.

Fixing the links from the Archived articles module to the Archived articles view does not make this view more attractive. It's only a question about code quality. -> get it to work.

Personally I would accept non SEO links like ?view=archive&year=xxxx&month=yy
But is has to work and call the view with the same funcionality as the non SEO does..

avatar zero-24
zero-24 - comment - 26 Aug 2015

Ok. yes Than i have missinderpret you ;)

avatar schnuti
schnuti - comment - 26 Aug 2015

Pull request #7773 added
Please test thoroughly!

Tested with Archive module and standard search.

With a menu item for Archived articles where archived-articles is the alias of the created menu.
link: "to-your-joomla/archived-articles/2010/12"

Without a menu item for Archived articles I have 2 cases
1. The active menu item is not a Content menu.
link: "to-your-joomla/component/content/archive/2010/12"
2. The active menu item is a Content menu.
link: "to-your-joomla/component/content/archive/2010/12?Itemid=101
i.e. sometimes the Itemid is added automaticly

avatar zero-24 zero-24 - close - 26 Aug 2015
avatar zero-24
zero-24 - comment - 26 Aug 2015

Ok I can try to test it tomorrow. As we have a pull we close here and continue on your PR #7773 Thanks

avatar zero-24 zero-24 - change - 26 Aug 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-08-26 19:22:43
Closed_By zero-24
avatar zero-24 zero-24 - close - 26 Aug 2015
avatar rdeutz rdeutz - reference | 3c848a3 - 11 Oct 15
avatar rjentsch
rjentsch - comment - 15 Apr 2016

Problem: Seo activated. Created a menu point to view archived articles. Articles where shown but the generated link to the article has been wrong. It includes the alias of the menu point created.
Solution: on line 23 of com_content/views/archive/tmpl/default_items.php adding a str_replace to the string in question, my line 23 now looks like this:
<a href="<?php echo str_replace("/news-archiv","",JRoute::(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language))); ?>" itemprop="url">_

i know thats bad habbit and awful but i'm not deep enough into joomla to get a real and for all working solution. At least it works at the customer now .....

I would like if someone can achieve the same in a proper and general way,,,,,and publishes it

avatar Hackwar
Hackwar - comment - 15 Apr 2016

This is not a help forum but a bug tracker. Please use forum.joomla.org

avatar rdeutz rdeutz - locked - 15 Apr 16

Add a Comment

Login with GitHub to post a comment