Make sure SEF is turned on (I haven't tested without it, but I assume it causes the same issue). But I guess there's a question as to whether this is SEF or the router.
Create a category. Give it an alias of "blog"
A two articles to the category of blog.
Create first article.
Give it an alias of "an-article"
Add some content and a read more
Add another article.
Give that some content and a read more.
Give it an alias of "blog-article"
Create another category. Give it an alias of "an-article"
Make it a subcategory of another category
Create a menu item of type category blog.
Link to the blog category.
Give an alias of blog
View this page
Clicking read more goes to the article.
On one article read more reaches the article.
The other article's read more goes to the category.
Totally different an unintended behaviour.
systeminfo-2021-05-11T20 49 36+01 00.txt
I am using the modern router setting
Litespeed has an official Joomla! plugin that is currently disabled until I work out some of the issues. I don't know if you meant officially by Litespeed or officially by Joomla
it is not related to the issue
Cannot confirm the issue.
The steps where not so clear, so i guess the second category didn't get a menu. Also i test modern routing with removed ids from url and not.
I test on a multilingual site, but categories, articles and menu for the issues are set on all languages.
The backend of articles and categories:
Please have a look at [url deleted], maybe i missed something.
Can you turn on so we can see the category names on your test site? The menu item shouldn't be called read more. That can be called blog or something (doesn't really matter but it is confusing)
Or is there a way you can give me access to testsite so I can ensure it has the same setup?
If you need to contact me just fill in the contact from www.squareballoon.co.uk
Category title now shows, [url deleted]
I meant when I click on an article to see what category it is in.
I did remember one other factor. The category was a subcategory. Perhaps that made a difference.
Ok I have updated, good advice thank you.
After the new information i cannot conform the issue.
The original issue was for Joomla 3.9, which we stopped bugfixes for a few months ago. In Joomla 4 you could generate this situation by setting the option to remove the IDs from the URL, then creating a category with a menu item and in that category creating a subcategory and an article with the same alias. In that case, Joomla will always try to load the category first and it would not be possible to access the article. I would assume that this is expected behavior and if someone would create such a setup, it would be the fault of the person and not exactly that of Joomla. We could introduce a check to compare the aliases of child categories of the category of an article and the article itself when editing it to either stop saving an article with such an alias or to at least display a warning, both only in case that SEF option is set.
I think a check is a good solution. Fault of the user or not, unless you know how the route works, you don't know that is the reason. I didn't know that, and many ordinary Joomla users wouldn't know that. Rather than trying to choose who is to blame I think a check would be a good option.
ah the "inception" check. Nice idea but technically can only work some of the time.
Yes, I know the check isn't a perfect solution and my hardcore developer heart says to just close this issue as "you break it, your fault", but in the end I can understand the problem and the check would not be overly complex. So I could live with implementing that and then closing this issue.
@brianteeman Why can it only work some of the time?
You could create
article->category->menu
menu->category->article
You could create a new menu at any time. How do you tell existing content there could be an issue.
ETC ETC
Couldn't you just do the check both ways? You don't tell the content, you tell the user, much in the same way you can't save two articles with the same alias.
on a site with 5000 articles ?
We're back to "it's the users fault", they shouldn't have 5,000 articles :) Honestly, I have no idea if it's feasible or not. Does it currently check the article alias in that situation?
You are asking that for every article save then there is a check for a matching alias in every category and every menu item and then warning the user that this might cause a problem for them and for every menu item save a similar check is performed and the check would need to be performed every time you move or copy an article etc etc
I wouldn't see this as totally different to when a new article is created already. I would expect menu items usually to be considerably less than 5,000 even if there are 5,000 articles on a website. The same with categories, surely the article check would be more burdensome. And I wouldn't warn a user that it might cause a problem, only if it would.
I have expressed my view - without code any further discussion (at least from me) is pointless
Labels |
Added:
No Code Attached Yet
bug
Removed: ? |
Maybe not relevant but you use litespeed and i read in other threads that joomla isn't official working on that (if i remember correct).