No Code Attached Yet bug
avatar akfaisel
akfaisel
2 Sep 2021

Steps to reproduce the issue

Open any Joomla 4 website and type https://faisel.joomla.com/index.php?option=com_users. This issue is with all other components as well say com_contact, etc.

This is issue is not with Joomla 3.10

Expected result

It is supposed to redirect to the login page.

Actual result

But it is showing the error page.

View not found [name, type, prefix]: featured, html, site

Call stack
#	Function	Location
1	()	JROOT/libraries/src/MVC/Controller/BaseController.php:898
2	Joomla\CMS\MVC\Controller\BaseController->getView()	JROOT/components/com_users/src/Controller/DisplayController.php:47
3	Joomla\Component\Users\Site\Controller\DisplayController->display()	JROOT/libraries/src/MVC/Controller/BaseController.php:730
4	Joomla\CMS\MVC\Controller\BaseController->execute()	JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146
5	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()	JROOT/libraries/src/Component/ComponentHelper.php:389
6	Joomla\CMS\Component\ComponentHelper::renderComponent()	JROOT/libraries/src/Application/SiteApplication.php:206
7	Joomla\CMS\Application\SiteApplication->dispatch()	JROOT/libraries/src/Application/SiteApplication.php:245
8	Joomla\CMS\Application\SiteApplication->doExecute()	JROOT/libraries/src/Application/CMSApplication.php:278
9	Joomla\CMS\Application\CMSApplication->execute()	JROOT/includes/app.php:63
10	require_once()	JROOT/index.php:32

System information (as much as possible)

=============
System Information
=============
php: Linux lamp115.cloudaccess.net 3.10.0-962.3.2.lve1.5.24.7.el6h.x86_64 #1 SMP Mon Dec 17 12:02:35 EST 2018 x86_64
dbserver: mysql
dbversion: 5.7.30-cll-lve
dbcollation: utf8_general_ci
dbconnectioncollation: utf8mb4_general_ci
dbconnectionencryption: 
dbconnencryptsupported: true
phpversion: 7.3.29
server: Apache
sapi_name: cgi-fcgi
version: Joomla! 4.0.2 Stable [ Furaha ] 24-August-2021 19:54 GMT
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

=============
PHP Settings
=============
memory_limit: 512M
upload_max_filesize: 360M
post_max_size: 380M
display_errors: true
short_open_tag: true
file_uploads: true
output_buffering: false
open_basedir: 
session.save_path: xxxxxx
session.auto_start: 0
disable_functions: socket_create,socket_connect,show_source,enable_dl,dl,memory_limit,socket_accept,socket_bind,socket_close,socket_create_listen,socket_create_pair,socket_listen,socket_recv,socket_recvfrom,socket_select,socket_send,socket_sendto,socket_shutdown
xml: true
zlib: true
zip: true
mbstring: true
gd: true
iconv: true
intl: true
max_input_vars: 10000

Additional comments

The actual problem is at ROOT/components/com_users/src/Controller/DisplayController.php
$vName = $this->input->getCmd('view', 'login');
If we echo $vName, it is always 'featured'. It is supposed to echo 'login'. Please try this and provide a fix.

avatar akfaisel akfaisel - open - 2 Sep 2021
avatar akfaisel akfaisel - change - 2 Sep 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 2 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Sep 2021
avatar chmst
chmst - comment - 2 Sep 2021

It cannot redirect to login - you never can know if there are users allowed to log in.
It is the same behaviour as in J3, isn't it?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35463.
avatar chmst chmst - change - 2 Sep 2021
Priority Urgent Medium
avatar chmst chmst - change - 27 Sep 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-09-27 19:50:09
Closed_By chmst
avatar chmst chmst - close - 27 Sep 2021
avatar chmst
chmst - comment - 27 Sep 2021

Seems to not so urgent ..

avatar brianteeman
brianteeman - comment - 27 Sep 2021

It is the same behaviour as in J3, isn't it?

No in Joomla 3 it gives you the login page

avatar brianteeman
brianteeman - comment - 27 Sep 2021

@chmst might not be urgent but it is a change in behaviour that could be fixed so could you please re-open this

avatar chmst chmst - change - 27 Sep 2021
Status Closed New
Closed_Date 2021-09-27 19:50:09
Closed_By chmst
avatar chmst chmst - reopen - 27 Sep 2021
avatar brianteeman
brianteeman - comment - 28 Sep 2021

so I can confirm that the code is supposed to default to the login when there is no view. that is what the com_users controller says.

the problem as you identified is that a view is being set. This is coming from the default menu item which in your case is a featured article.

I will continue investigating later today - ran out of time for now.

avatar joomdonation
joomdonation - comment - 29 Sep 2021

This issue causes by a bug in our routing code, in this method https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Router/SiteRouter.php#L331

In this case, we merge query data from default menu item (The Home menu item, by default, it links to Featured view of com_content, index.php?option=com_content&view=featured). It makes the view variable becomes featured (instead of default view set in Display controller of com_users) and it causes the error

@Hackwar Could you please look at this issue?

avatar brianteeman
brianteeman - comment - 29 Sep 2021

Thanks for confirming my findings

avatar mahagr
mahagr - comment - 15 Nov 2021

I can confirm this issue. In this case, the view merging issue can be easily fixed by not merging the query variables if the option (or the component) does not match. Menu item parameters are meant for that component only.

Unfortunately, even after my "fix", merging the query parameters conditionally will still fail if the home menu item used the same component, such as articles. In that case, the home menu item may pass extra parameters which change the behavior of the page (view, filters etc). This means that merging query parameters is always bad as it can change the supposed behavior of the link.

However, the new raw routing logic has even more unintended side effects than breaking the pages.

It also changes the template layout which is being used for showing the page. Basically, if you had a site with a special home layout using a different template, or Gantry where the home page is set to render different content altogether (see gantry/gantry5#2938), all the pages which used default layout are using the home layout in Joomla 4.

You can even test this with Cassiopeia; create a new Home layout with a large logo, sticky header, and custom color theme. Only the home page should have those, but you end up having a site where a lot of pages have those custom settings which were meant for the home page only. This can be seen by displaying tags in the blog and clicking on a tag. As the tags component doesn't have its own menu item, the page has the wrong logo, wrong colors, and a stickly header.

Or even easier to test: install a second template to the site and assign it to Home page only. In Joomla 3 only the home page used this new template, in Joomla 4 almost every page will use it. The only way to fix that is to add a lot of menu items and hope that Joomla uses menu routes instead of component routes (which many components do not do!).

I think that the old behavior in Joomla 3 was the correct one: with Itemid=0 it didn't add broken query params nor used the wrong layout to display content from components that didn't have menu items assigned to them.

avatar brianteeman
brianteeman - comment - 15 Nov 2021

You can even test this with Cassiopeia; create a new Home layout with a large logo, sticky header, and custom color theme. Only the home page should have those, but you end up having a site where a lot of pages have those custom settings which were meant for the home page only. This can be seen by displaying tags in the blog and clicking on a tag. As the tags component doesn't have its own menu item, the page has the wrong logo, wrong colors, and a stickly header.

Nothing is different here from j3. It has always been the case that if there is no suitable itemid (ie no menu item) then the itemid of the referring page will be used.

The rest is a bug as already explained - just needs someone to fix it

avatar mahagr
mahagr - comment - 15 Nov 2021

I just used a couple of hours to test both Joomla 3 and 4 and the behavior is very different in Joomla 4. Joomla 3 sets Itemid=0 where Joomla 4 uses Itemid=105, or the Home menu item. Using the home menu item is wrong as it breaks both the query params and the layout assignment.

Think of a site that has a green home page and every other page is red. It worked in Joomla 3 just fine, but in Joomla 4 most of the pages will use the wrong color as almost every page will use the home menu item.

PS. I forgot to mention that this also breaks module assignments: your image carousel from the home page will show up on every component page without a menu item.

avatar Polm90
Polm90 - comment - 9 Feb 2023

issue is still present in joomla 4.2.7. It also affects all frontend forms which use a field type user.
I think it's important to fix...

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar Hackwar
Hackwar - comment - 14 Mar 2024

Can you check if #42989 improves this for you?

avatar Hackwar
Hackwar - comment - 26 Mar 2024

Can you check #43164 if that helps you?

avatar Hackwar Hackwar - change - 30 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-30 16:05:31
Closed_By Hackwar
avatar Hackwar Hackwar - close - 30 Mar 2024
avatar Hackwar
Hackwar - comment - 30 Mar 2024

Since #43164 seems to fix this, I'm closing this issue.

Add a Comment

Login with GitHub to post a comment