? Success

User tests: Successful: Unsuccessful:

avatar shur
shur
27 Sep 2014

The request is to use the same principle for creating links to articles in content modules. Since catslug is used in some modules and is not used in other module, this potentially leads to double article URLs (when SEF is disabled). But there is no need to use catslug in Joomla 3.x because process link function - ContentHelperRoute::getArticleRoute - requires only catid (integer value).
/components/com_content/helpers/route.php
public static function getArticleRoute($id, $catid = 0, $language = 0)

After going deeper into the issue I came to conclusion that only catid must be used, and catslug must be removed.

Steps to reproduce the issue

  • disable SEF (SEO Settings - set all fields: No)
  • publish thee content modules Articles Category Module, Latest News Module, Articles Newsflash Module in the same page for comparison.
  • In the module settings select the same one category as source (the same for three modules).
  • Compare URLs to the same article in different modules.

The results I got:
Articles Category Module
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12:category-alias&Itemid=101

Articles Newsflash Module
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101

Expected result
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101
All the links to the same article must be identical in all modules. Otherwise, it's a serious SEO mistake.

avatar shur shur - open - 27 Sep 2014
avatar jissues-bot jissues-bot - change - 27 Sep 2014
Labels Added: ?
avatar brianteeman
brianteeman - comment - 27 Sep 2014

Does anyone ever use Joomla with SEF completely disabled?

On 27 September 2014 10:51, shur notifications@github.com wrote:

The request is to use the same principle for creating links to articles in
content modules. Since catslug is used in some modules and is not used in
other module, this potentially leads to double article URLs (when SEF is
disabled). But there is no need to use catslug in Joomla 3.x because
process link function - ContentHelperRoute::getArticleRoute - requires only
catid (integer value).
/components/com_content/helpers/route.php
public static function getArticleRoute($id, $catid = 0, $language = 0)

After going deeper into the issue I came to conclusion that only catid
must be used, and catslug must be removed.

Steps to reproduce the issue

  • disable SEF (SEO Settings - set all fields: No)
  • publish thee content modules Articles Category Module, Latest News Module, Articles Newsflash Module in the same page for comparison.
  • In the module settings select the same one category as source (the same for three modules).
  • Compare URLs to the same article in different modules.

The results I got:
Articles Category Module

http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12:category-alias&Itemid=101

Articles Newsflash Module

http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101

Expected result

http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101
All the links to the same article must be identical in all modules.

Otherwise, it's a serious SEO mistake.

You can merge this Pull Request by running

git pull https://github.com/shur/joomla-cms patch-8

Or view, comment on, or merge it at:

#4363
Commit Summary

  • Remove catslug in mod_articles_category

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4363.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar shur
shur - comment - 27 Sep 2014

@brianteeman
Yes, some people do that (SEF disabled by default).
From time to time my clients request help about different URLs to articles.

It's good that SEF enabled helps to avoid double URLs to articles. But I think it's even better not to create this problem at all.

avatar zero-24 zero-24 - change - 27 Sep 2014
Category Front End Modules
avatar betweenbrain
betweenbrain - comment - 27 Sep 2014

Please see issue #4358 for related discussion and details.

In short, I don't know if we can safely remove catslug as third-party extensions may rely on that part of the URL parameter.

avatar yanivRozenman yanivRozenman - test_item - 19 Nov 2014 - Tested successfully
avatar yanivRozenman
yanivRozenman - comment - 19 Nov 2014

@test: Tested successfully, when I applied the patch I saw it happening as expected.

avatar Bakual
Bakual - comment - 19 Nov 2014

In short, I don't know if we can safely remove catslug as third-party extensions may rely on that part of the URL parameter.

You can't remove $item->catslug. Not so much because of 3rd parties but because of template overrides which may use it.

However you can deprecate it and remove the useage of it.

On the other hand, it may be the wrong approach and the category slug should actually be present always like the article slug. Don't know why com_content itself doesn't use it to be honest.

avatar shur
shur - comment - 20 Nov 2014

@yanivRozenman thanks for the test.

avatar betweenbrain
betweenbrain - comment - 20 Nov 2014

You can't remove $item->catslug. Not so much because of 3rd parties but because of template overrides which may use it.

I would more broadly say that we can't guarantee how it's being used and that removing any URL parameter is a backwards incompatible break.

I'd rather see it deprecated and remove it in 4.0 if it is deemed safe to remove.

avatar shur
shur - comment - 20 Nov 2014

@Bakual
Could you give any proof for you statement about template overrides?

What I know is that module layouts/templates use ready links ($item->link) but no $item->catslug is ever used.

avatar Bakual
Bakual - comment - 20 Nov 2014

What I know is that module layouts/templates use ready links ($item->link) but no $item->catslug is ever used.

The point is, you don't know that. A template or an extension may use it for whatever reason.
Removing the item property would break it without any warning beforehand.
According to our development strategy, we deprecate things and remove it with the next major version. Which would be 4.0.

avatar brianteeman
brianteeman - comment - 30 Nov 2014

Setting to Needs Review for a maintainer to decide on the B/C issues mentioned by @Bakual

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

avatar brianteeman brianteeman - change - 30 Nov 2014
Status Pending Needs Review
avatar Bakual
Bakual - comment - 1 Dec 2014

This doesn't need a review since already two PLT members said that it's not B/C.
Leave the catslug property there and we can look at it again.

avatar brianteeman
brianteeman - comment - 1 Dec 2014

Thanks. Setting info required to wait for an update or this will be closed in a few weeks

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

avatar brianteeman brianteeman - change - 1 Dec 2014
Status Needs Review Information Required
avatar shur
shur - comment - 6 Dec 2014

The purpose of this PR is to get rid of double article URLs created by content modules, and make these URLs to comply with article URLs generated by core content component (which doesn't use catslug).
This problem exists now and I think that it would be great to solve it in the next release, not in the distant future.

The only objection to this PR is a weak possibility that:
1. Some third party template builder (not an extension but a template)
2. includes this module layout to use it in template overrides
3. and changes this layout so much that it starts using catslug for some reason I cannot imagine.

Well, I agree that this is potentially probable. But the probability of this is negligible.

If it's the only objection that prevents this request from being accepted for the next release, then I have a suggestion:
Leave $item->catslug available but remove it only from article URLs generated by content modules, so that these URLs are the same as generated by core content component.

avatar Bakual
Bakual - comment - 6 Dec 2014

If it's the only objection that prevents this request from being accepted for the next release, then I have a suggestion:
Leave $item->catslug available but remove it only from article URLs generated by content modules, so that these URLs are the same as generated by core content component.

Exactly that. Leave the $item->catslug property available but don't use it yourself. Then it is fully B/C.
If you want to make it perfect, you can add a deprecated notice somewhere.

avatar shur
shur - comment - 7 Dec 2014

Exactly that. Leave the $item->catslug property available but don't use it yourself. Then it is fully B/C.
If you want to make it perfect, you can add a deprecated notice somewhere.

Done. Now there should not be any B/C problems.

avatar shur shur - close - 14 Dec 2014
avatar shur
shur - comment - 14 Dec 2014

@Hackwar
Finally, this problem has been solved

I close this PR as completely solved here: #5276

avatar shur shur - close - 14 Dec 2014
avatar shur shur - change - 14 Dec 2014
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2014-12-14 07:56:18
avatar shur shur - head_ref_deleted - 14 Dec 2014

Add a Comment

Login with GitHub to post a comment