?
avatar infograf768
infograf768
4 Jun 2017

Reference: #13633

@mbabker
It has not changed in 3.8-dev
Whether in monolanguage or multilingual, if we do not have a published menu item (hidden or not) of type Category or List all Categories, when we click on the articles links displayed through a Featured menu item (here as Home) we get urls of the type

index.php?view=article&id=1:article1
index.php?view=category&id=8

Testing conditions are the same as I posted above.

Therefore, if this cannot be changed, we have to modify the default multilingual installation to create Category Blogs as default Home instead of Featured menu items.


Note: if I choose a category blog as menu item to test with I have a Fatal error
`( ! ) Fatal error: Class 'Joomla\CMS\View\View' not found in .../libraries/src/Joomla/CMS/View/Category.php on line 19

avatar infograf768 infograf768 - open - 4 Jun 2017
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jun 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jun 2017
avatar mbabker
mbabker - comment - 4 Jun 2017

Therefore, if this cannot be changed, we have to modify the default multilingual installation to create Category Blogs as default Home instead of Featured menu items.

Based on the way the new system is set up, I believe we will need to change the multilingual installation. A featured item view isn't part of the content hierarchy so it can't logically be a parent view to an article or category.

Note: if I choose a category blog as menu item to test with I have a Fatal error

Fixed via 3eda09e

avatar mbabker
mbabker - comment - 4 Jun 2017

I'm just going to throw the comment here since it's essentially the same logic. If you use the archived articles view, you get the same issue.

With the existing router, it is possible to get SEF URLs when routing to archived content. The newer system isn't able to.

Current Router New Router
/archived-articles/9-uncategorised /archived-articles?view=category&id=9
/archived-articles/9-uncategorised/67-whats-new-in-15 /archived-articles?view=article&id=67:whats-new-in-15

From a technical perspective, this is correct as the archived view is not part of the general view hierarchy (categories => category => article). In the case of archived content though, it really feels like it should be able to *somehow* be a parent view as archived is a content state (whereas featured isn't part of the state system but another setting).

avatar infograf768
infograf768 - comment - 4 Jun 2017

Evidently, with that logic, if we set the Home page to a single article and display in the Details the link to the category (and still no menu item linking to this category or Categories), we get the same type of URL when clicking on the Category link.
index.php?view=category&id=8

When there is no menu item of type category or Categories, my expectation (and it seems also for many users) is to get something like

index.php/aliasofcategory

and in the case of the article link in my first post:
index.php/alieasofcategory/aliasofarticle

where aliasofcategory corresponds to category with id 8 and aliasofarticle article with id 1.

Is it possible to modify this new router to obtain that kind of url?

avatar mbabker
mbabker - comment - 4 Jun 2017

When there is no menu item of type category or Categories, my expectation (and it seems also for many users) is to get something like index.php/aliasofcategory

Is it possible to modify this new router to obtain that kind of url?

Since the new router has a more "pluggable" based approach (ability to add custom rules to the processing), in theory someone could work on a plugin to add that type of logic. But I don't know right now if we could get that to a stable point before 3.8.

If we were to start generating URLs like index.php/aliasofcategory by default instead of either non-SEF URLs or our current index.php/component/content/category/8-aliasofcategory paths, the router would then at least have to start querying the categories table to figure out how to handle routing if it can't do the routing based on the menu system, then we get into an issue of ensuring that the root categories are unique (how do you handle index.php/uncategorised as an example when each component in core has that category).

I do think it's a "fun" issue to work through, but it's going to take some time to get that right.

avatar infograf768
infograf768 - comment - 4 Jun 2017

Would it be sensible to at least check if there is a suitable menu item to use and, if not, degrade to legacy URLs?

Note: will see (if it easy) how to modify anyway the default multilingual install. ;)

avatar mbabker
mbabker - comment - 4 Jun 2017

There's another issue open for that degrade thinking. So it's also being
thought about and discussed.

On Sun, Jun 4, 2017 at 12:16 PM infograf768 notifications@github.com
wrote:

Would it be sensible to at least check if there is a suitable menu item to
use and, if not, degrade to legacy URLs?

Note: will see (if it easy) how to modify anyway the default multilingual
install. ;)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16496 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoT1Qtj20D-fpfMkcf4WujlbMB4Kfks5sAoQIgaJpZM4NvTHj
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Jun 2017
Category Router / SEF
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Jun 2017
Status New Discussion
avatar AlexRed
AlexRed - comment - 5 Jun 2017

I can confirm the problem with the orphan article.

Would it be sensible to at least check if there is a suitable menu item to use and, if not, degrade to legacy URLs?

it is a good idea, if it is possible.

My simple test to confirm the problem:
Joomla 3.8.0dev, no sample data

Create a new article, title: orphan01 --> in the Category: Uncategorised
Create a new Category, title: blog
Create a new article, title: article01 --> in the Category: blog
in the "article01" text use the "Article" editor button to insert a link to orphan01
Create a new item menu "Category Blog", Choose a Category --> blog and title: Menu Category Blog

see in frontend from the category blog menu:
index.php/menu-category-blog/2-article01
and the link inside article01 to orphan01:
index.php/menu-category-blog/2-uncategorised/1-orphan01 Status ok

rename .htaccess
enabled "Use URL Rewriting"
enabled "Adds Suffix to URL"

see in frontend from the category blog menu:
menu-category-blog/2-article01.html
and the link inside article01 to orphan01:
menu-category-blog/2-uncategorised/1-orphan01.html Status ok

enabled URL Routing "Experimental"
enabled Remove IDs from URLs "Yes"

menu-category-blog/article01.html
and the link inside article01 to orphan01:
menu-category-blog/orphan01.html Status Error 404 URL invalid

avatar Crolug
Crolug - comment - 20 Aug 2017

To sum all things up - new router does NOT work on multilanguage sites, archives, featured and orphan articles? Am I understanding it correctly? Is it flagged as "broken" or is it intentional behavior?

avatar DanielRuf
DanielRuf - comment - 23 Sep 2017

Still does not work we get ?view=article&id=99:

avatar csthomas
csthomas - comment - 24 Sep 2017

I tested my PR #17746 on the above @AlexRed test instruction with success.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Sep 2017

@DanielRuf can you please test #17746?

avatar DanielRuf
DanielRuf - comment - 24 Sep 2017

@franz-wohlkoenig is there a way to patch core files without directly modifying them?
Also I still do not understand why the routing component is done so overcomplicated. Check if slug exists in database / structure or remove ID is set => remove ID and use slug. Otherwise use ID.

So far other CMS have not such issues and some also use symfony/routing.

Just my personal opinion about this neverending routing story. (I know that Joomla tries to reinvent the wheel in some areas for example regarding the cryptography. Don't do this and reuse established composer packages ;-) ).

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Sep 2017

is there a way to patch core files with directly modifying them?

@wojsmol ?

avatar wojsmol
wojsmol - comment - 24 Sep 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Sep 2017

@wojsmol haven't understand Question.

avatar wojsmol
wojsmol - comment - 24 Sep 2017

@franz-wohlkoenig I'm also not 100% sure about the answer, but @DanielRuf always can ask additional questions :)

avatar DanielRuf
DanielRuf - comment - 24 Sep 2017

*without.

avatar DanielRuf
DanielRuf - comment - 24 Sep 2017

So both solutions do the same? I would prefer patch using SSH, or is the Patch Tester the recommended and better way?

avatar DanielRuf
DanielRuf - comment - 24 Sep 2017

Personally I would recommend https://github.com/cweagans/composer-patches, can we add this to Joomla core in master?

avatar brianteeman
brianteeman - comment - 24 Sep 2017

That wont help you at all

avatar wojsmol
wojsmol - comment - 24 Sep 2017

@DanielRuf Do a separate Joomla! installation from staging branch of this repository then you can apply .patch or.diff from ssh and test :)

avatar DanielRuf
DanielRuf - comment - 24 Sep 2017

That wont help you at all

What exactly do you mean?

@DanielRuf Do a separate Joomla! installation from staging branch of this repository then you can apply .patch or.diff from ssh and test :)

This is our current approach but I would welcome something like composer-patches. Well, then we have to manually apply, test and remove the patch / diff.

avatar csthomas
csthomas - comment - 25 Sep 2017

@DanielRuf You can:

  1. Download patched version from https://github.com/csthomas/joomla-cms/archive/route_fix.zip
  2. Extract it.
  3. Install new joomla or replace/add configuration.php file from your other installation in order to do tests on existed database.
  4. Check your links.
avatar csthomas
csthomas - comment - 1 Oct 2017
Current Router New Router
/archived-articles/9-uncategorised /archived-articles?view=category&id=9
/archived-articles/9-uncategorised/67-whats-new-in-15 /archived-articles?view=article&id=67:whats-new-in-15

Current behaviour of modern routing

  • My PR only more explicitly that.

Article should not change URL when is moved from published state to archive state.
Article should always exists at /component/content/9-uncategorised/67-whats-new-in-15 or equivalent with itemid like /uncategorised/67-whats-new-in-15

After archive, the article disappears from category view (listing) and appears on archive view, URL is not changed.

avatar csthomas
csthomas - comment - 3 Nov 2017

There are some issues with the new URL routing, but it is difficult to find someone who will test PRs about URL routing.

If someone has a little time I suggest to test #18429, which is part of older, more complex #17746

I would like to write more code to improve the new URL routing but usual I have to wait until previous PR will be merged.

avatar brianteeman
brianteeman - comment - 5 Jan 2018

I am closing this - as #18429 has been merged

avatar brianteeman brianteeman - change - 5 Jan 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-01-05 23:21:28
Closed_By brianteeman
avatar brianteeman brianteeman - close - 5 Jan 2018

Add a Comment

Login with GitHub to post a comment