No Code Attached Yet bug
avatar ironbone
ironbone
20 Jun 2023

I have an (almost empty) ArticleController extends BaseController on the site part

I use there
protected $default_view = 'article';

When using the URL
http:/myhost/index.php/component/nycomponent/?controller=Article&id=70

I get the error:
View not found [name, type, prefix]: featured, html, site

The view featured comes from the input so my default_view is ignored

System information (as much as possible)

Opensuse
PHP 8.1
Joomla 4.3.2

Additional comments

avatar ironbone ironbone - open - 20 Jun 2023
avatar ironbone ironbone - change - 20 Jun 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jun 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jun 2023
avatar chmst
chmst - comment - 20 Jun 2023

If I understand correctly, you are working on an own component?

In my experience, these errors are always caused by wrong usage of namespace, typos in filenames or wrong classnames.

You could join the extension development cannel on our mattermost https://joomlacommunity.cloud.mattermost.com.
There are developers who can help you.

I close this as it is not a bug in Joomla. We can re-open if you are sure that it is a bug,

avatar chmst chmst - change - 20 Jun 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-06-20 20:05:42
Closed_By chmst
avatar chmst chmst - close - 20 Jun 2023
avatar ironbone
ironbone - comment - 20 Jun 2023

I think, this is a bug. Let me present my short example.
This is a container where I get the error:

class ArticleController extends BaseController{

	protected $default_view = 'article';

	public function display($cachable = false, $urlparams = array()) {
		return parent::display($cachable, $urlparams);
	}
}

When I change it to the following - there is no error.

class ArticleController extends BaseController{
	protected $default_view = 'article';

	public function display($cachable = false, $urlparams = array()) {
		$view = $this->input->get('view');
		if($view == 'featured') {
			$this->input->set('view', $this->default_view);
		}
		return parent::display($cachable, $urlparams);
	}
}

It means (in my opinion) that there are no missing parts in my code.

What is interesting, the problem appears ONLY on the Front End. When I do is in Admin Part there is no problem.

avatar chmst chmst - change - 21 Jun 2023
Status Closed New
Closed_Date 2023-06-20 20:05:42
Closed_By chmst
avatar chmst chmst - reopen - 21 Jun 2023
avatar joomdonation
joomdonation - comment - 24 Feb 2024

There is nothing wrong with the code in BaseController. The real reason here is that your link does not contains Itemid variable value is ID of the menu item associated with your component. So Joomla uses Home menu item as the active and pass variables from query of that menu item to your request (The Home menu item is linked to view featured of com_content by default, that's the reason you has featured when trying to get view from input)

This routing issue is something which Joomla needs to address. However, while waiting for it to work properly, you can use that workaround code or passing right value for Itemid variable in your link.

avatar Quy Quy - change - 29 Feb 2024
Labels Added: Information Required
avatar Quy Quy - labeled - 29 Feb 2024
avatar Quy Quy - change - 29 Feb 2024
Labels Removed: Information Required
avatar Quy Quy - unlabeled - 29 Feb 2024
avatar brianteeman
brianteeman - comment - 24 Mar 2024

@Hackwar pinging you as this appears to be linked to the recent work you have been doing. Perhaps you already fixed this

avatar Hackwar
Hackwar - comment - 24 Mar 2024

Indeed, this would most likely be solved by #42989. @ironbone can you check if that helps you?

avatar Hackwar Hackwar - change - 24 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 24 Mar 2024
avatar Hackwar Hackwar - change - 30 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-30 17:57:55
Closed_By Hackwar
avatar Hackwar Hackwar - close - 30 Mar 2024
avatar Hackwar
Hackwar - comment - 30 Mar 2024

Since we have #42989, I'm closing this issue.

Add a Comment

Login with GitHub to post a comment