[BETA] Class "Joomla\CMS\Factory\BaseHtmlView" not found #1066
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1066
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
compile a component with JCB 3.2.0-beta2 on Debian GNU/Linux 11 (bullseye), 10.5.23-MariaDB-0+deb11u1, PHP 8.0.30, Joomla! 3.10.12, using a fresh Firefox Developer edition (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0) without any addons
Install on a fresh Joomla 4.4.3 (10.5.23-MariaDB-0+deb11u1, PHP 8.2.16, Apache2) and set up a menu item for a site view
Expected result
site view is shown
Actual result
No problems in backend - at least I didn't notice any, but in frontend it throws errors:
Class "Joomla\CMS\Factory\BaseHtmlView" not found
Call Stack:
Function Location
1 () JROOT/components/com_cmv/src/View/Vorkonfiguration_lp/HtmlView.php:46
2 include() JROOT/libraries/vendor/composer/ClassLoader.php:571
3 Composer\Autoload\includeFile() JROOT/libraries/vendor/composer/ClassLoader.php:428
4 Composer\Autoload\ClassLoader->loadClass() JROOT/libraries/src/Autoload/ClassLoader.php:59
5 Joomla\CMS\Autoload\ClassLoader->loadClass()
6 class_exists() JROOT/libraries/src/MVC/Factory/MVCFactory.php:283
7 Joomla\CMS\MVC\Factory\MVCFactory->getClassName() JROOT/libraries/src/MVC/Factory/MVCFactory.php:198
8 Joomla\CMS\MVC\Factory\MVCFactory->createView() JROOT/libraries/src/MVC/Controller/BaseController.php:581
9 Joomla\CMS\MVC\Controller\BaseController->createView() JROOT/libraries/src/MVC/Controller/BaseController.php:834
10 Joomla\CMS\MVC\Controller\BaseController->getView() JROOT/libraries/src/MVC/Controller/BaseController.php:615
11 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_cmv/src/Controller/DisplayController.php:119
12 JCB\Component\Cmv\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:693
13 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
14 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/components/com_cmv/src/Dispatcher/Dispatcher.php:43
15 JCB\Component\Cmv\Site\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
17 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
18 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
20 require_once() JROOT/index.php:32
System information (as much as possible)
Additional comments
components/com_cmv/src/View/Vorkonfiguration_lp/HtmlView.php looks like this:
namespace JCB\Component\Cmv\Site\View\Vorkonfiguration_lp;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use JCB\Component\Cmv\Site\Helper\HeaderCheck;
use JCB\Component\Cmv\Site\Helper\CmvHelper;
use JCB\Component\Cmv\Site\Helper\RouteHelper;
use VDM\Joomla\Utilities\StringHelper;
namespace Joomla\CMS\Factory;
// No direct access to this file
\defined('_JEXEC') or die;
/**
/
class HtmlView extends BaseHtmlView
{
/*
*/
[...]
So I set up a completely fresh Joomla 3.10.12, downloaded a fresh JCB 3.2.0-beta2, compiled the demo component and installed it on the same site, I installed the first component on.
Here too, I get some class not found error, but a different one:
Class "DemoHelperRoute" not found
Call stack:
Function Location
1 () JROOT/components/com_demo/tmpl/looks/default.php:44
2 include() JROOT/libraries/src/MVC/View/HtmlView.php:415
3 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/libraries/src/MVC/View/HtmlView.php:203
4 Joomla\CMS\MVC\View\HtmlView->display() JROOT/components/com_demo/src/View/Looks/HtmlView.php:82
5 Kommid\Component\Demo\Site\View\Looks\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660
6 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_demo/src/Controller/DisplayController.php:119
7 Kommid\Component\Demo\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:693
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
9 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/components/com_demo/src/Dispatcher/Dispatcher.php:43
10 Kommid\Component\Demo\Site\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
12 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
13 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
14 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
15 require_once() JROOT/index.php:32
Beginning of components/com_demo/tmpl/looks/default.php:
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Kommid\Component\Demo\Site\Helper\DemoHelper;
// No direct access to this file
defined('_JEXEC') or die;
?>
items as $item): ?>`
Also tried it with SEF and default .htaccs as well as without SEF (.htaccess renamed)
I also installed my component on a fresh joomla on a different server (webhosting server using plesk) with the same result.
Since it seems that this wasn't reported before, and I also have errors with the pre-installed demo extension from JCB, I suspect some problem on my end, but I'm really at a loss here and I'd be greatful for any help on how to resolve this.
What I found is that there is an issue when we have
_
in the component name... and I know this will be a pain... and I have not yet been able to fully understand why. But its namespace related... so I am seeingVorkonfiguration_lp
in the error dump log... if you remove the space or_
in the name does it resolve things?As for the demo extension I have not yet worked on its front-end... so if may still need some love.
Yepp, this is going to be a pain :)
I'll give it a shot and report back here
thank you so much for this tip :)
It helped somewhat - now It can't find the helper class:
Class "JCB\Component\Cmv\Site\Helper\CmvHelper" not found
Call stack
Function Location
1 () JROOT/components/com_cmv/src/View/Vorkonfigurationlp/HtmlView.php:233
2 JCB\Component\Cmv\Site\View\Vorkonfigurationlp\HtmlView->addToolbar() JROOT/components/com_cmv/src/View/Vorkonfigurationlp/HtmlView.php:69
3 JCB\Component\Cmv\Site\View\Vorkonfigurationlp\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660
4 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_cmv/src/Controller/DisplayController.php:119
5 JCB\Component\Cmv\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:693
6 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
7 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/components/com_cmv/src/Dispatcher/Dispatcher.php:43
8 JCB\Component\Cmv\Site\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
10 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
11 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
12 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
13 require_once() JROOT/index.php:32
In vorkonfigurationlp the use statement for the helper class is present:
namespace JCB\Component\Cmv\Site\View\Vorkonfigurationlp;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use JCB\Component\Cmv\Site\Helper\HeaderCheck;
use JCB\Component\Cmv\Site\Helper\CmvHelper;
use JCB\Component\Cmv\Site\Helper\RouteHelper;
use VDM\Joomla\Utilities\StringHelper;
[...]
protected function addToolbar(): void
{
...the bold part is line 233, it's complaining about.....
Do I have to put any headers in the class headers tab of my site view?
Yes, if you are calling classes that JCB is not already adding to header... then you must add it yourself.
But JCB should be adding the header for
CmvHelper
Hmm I see it did... is the file there?
So yesterday our in house testing Team found that they could not get a few of our own components to work, it kept missing classes. We then discovered that the installer of Joomla times-out and the complete package does not install, even thought it says that it did. So they asked me what tweaks to PHP I am using on my development system. So here is my PHP.ini tweaks:
If you add these, and install JCB again.... and also on the system where your planning to install you component... I think it will resolve your problem. Yes, you could remove this in most cases after the install, but in your development system it might be best to keep it on.
But for large extensions like those that JCB can build making these changes seems necessary, at least on the initial install.
Sorry for my late answer, I didn't have a opportunity to work on this for a few days. It seems, that did the trick. It now finds the helper class.