? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
30 Aug 2018

Problem: on a multilingual site, when displaying the info-block for articles in frontend , the urls of the category and parent category are real bad.

Summary of Changes

  1. ContentHelperRoute::getCategoryRoute() should ALWAYS contain the $language variable.
    This PR adds it wherever necessary, including in layouts/joomla/content/info-block/corresponding files. Queries are modified to also select the category language. The language is also added in data.

  2. com_content/helpers/route.php should cope with categories set to ALL languages
    The code is modified to take this into account as, in this case, the language to use in the url should be the language of the UI content language.

  3. com_content/helpers/route.php should not add for example &layout=cassiopeamyblog to the end of the sef url when such a specific html/com_content/category/myblog.etc menu item type is present in the template.
    To solve this, I had to revert #19681

Testing Instructions

Install a multilingual site with 2 content languages.
Tests can be done on a single language. Choose en-GB for example as it is easier.

Create some categories and articles in these categories both tagged to the same language [CATen-GB, CATfr-FR].
Create a home blog menu item for each content language to display one CATen-GB and one CATfr-FR
Make sure you create a (hidden or not) List All Categories menu item tagged to en-GB in mainmenu en-GB.
=> This is important as any category which has no specific menu item will still get a nice sef url.

Create also a Category set to ALL language and a child category of that category (tagged to ALL or to en-GB). Add to the child category an article tagged to en-GB ("Articletest").
Create a single menu item in mainmenu en-GB to display the "articletest" article.

Now, the second part of the test concerns the revert of the layout code in route.php.
To test this, it is necessary to add a new menu item type.
Find here a .zip of the files to add in /templates/cassiopeia/html/com_content/category/
myblog.zip

Create a menu item using this type in mainmenu en-GB to display any category not yet displayed by the former menu items.

In Articles Options, make sure show category and link as well as show Parent category and link are set to yes.
Make sure all your menu items use these global settings

Expected result

When clicking on the Category or Parent category links you should get nice urls
not containing some stuff like
?view=category&id=18
or
&layout=cassiopeamyblog when using the custom menu item type

Instead one may get for example when no menu item for the category
/en/allcategories-en-gb/category-all (here set to ALL)
or
/en/allcategories-en-gb/category-all/othercaten-gb (category set to en-GB)

and same for the custom menu item type (myblog menu item type)
screen shot 2018-08-30 at 12 20 50

Note A

Reverting #19681 is necessary.
We should look for another way to implement this feature.

Note B

The modifications concerning getCategoryRoute() and route.php should also be done for other components using this method.

@alikon @Hackwar @csthomas

avatar infograf768 infograf768 - open - 30 Aug 2018
avatar infograf768 infograf768 - change - 30 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2018
Category Front End com_content Layout
avatar infograf768
infograf768 - comment - 31 Aug 2018

On it for most parts except the fingerprint of the method

avatar infograf768 infograf768 - change - 31 Aug 2018
Labels Added: ?
avatar infograf768
infograf768 - comment - 31 Aug 2018

@Hackwar
Got rid of slugs for category and parent category. Modified info-block to fit.
Did not modify getCategoryRoute() method. I guess this can/should be done in another PR.

After merge, will work on other components.

avatar joomla-cms-bot joomla-cms-bot - change - 31 Aug 2018
Category Front End com_content Layout Front End com_content Layout Libraries
avatar infograf768
infograf768 - comment - 31 Aug 2018

@Hackwar
Set the $language to $active->language when multilang and item tagged to ALL in the Router, therefore getting rid of $lang in route.

avatar infograf768
infograf768 - comment - 31 Aug 2018

after some further tests, i think my changes in menurules are not enough.

avatar infograf768
infograf768 - comment - 1 Sep 2018

restarted drone as non-related error

avatar csthomas
csthomas - comment - 1 Sep 2018

The code is OK. I wonder if this issue occurs on J3?

avatar csthomas
csthomas - comment - 1 Sep 2018

I have tested this item successfully on e06a014


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

avatar csthomas csthomas - test_item - 1 Sep 2018 - Tested successfully
avatar zero-24
zero-24 - comment - 4 Sep 2018

I have tested this item successfully on e06a014


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

avatar zero-24 zero-24 - test_item - 4 Sep 2018 - Tested successfully
avatar zero-24 zero-24 - change - 4 Sep 2018
Status Pending Ready to Commit
avatar laoneo laoneo - change - 6 Sep 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-09-06 05:56:22
Closed_By laoneo
Labels Added: ?
avatar laoneo laoneo - close - 6 Sep 2018
avatar laoneo laoneo - merge - 6 Sep 2018
avatar laoneo
laoneo - comment - 6 Sep 2018

Thanks

Add a Comment

Login with GitHub to post a comment