Template Zero/One version 2.4.1 : error 404 not working
Astroid FrameWork 2.4.3, Template Zero 2.4.1
Depending on default menu definition, error 404 handling may or not work.
When not working, following message is displayed:
Please install and activate Astroid Framework in order to use this template.
If default menu is a com_content page (blog, article), error 404 is created by an exception in Joomla Router (libraries/src/Router/SiteRouter.php, line 139). In this case, Astroid plugin 'onRoute' event is never called and Astroid Framework being not loaded, wrong error screen is created.
Otherwise (if, for example, default page is weblink component), error 404 will be called by libraries\legacy\error\error.php, line 277, and, at this point, Astroid Framework has been loaded.
To solve this, in error.php file, replace
defined('_JEXEC') or die;
defined('_ASTROID') or die('Please install and activate <a href="https://www.astroidframework.com/" target="_blank">Astroid Framework</a> in order to use this template.');
by
defined('_JEXEC') or die;
use Astroid\Framework;
if (!defined('_ASTROID')) {
Framework::init();
}
I too am getting this error and it is also caused by a routing error
Please install and activate Astroid Framework in order to use this template.
I would also lile to add the following
- in the astroid system plugin, enabling or disable does not make any difference to display errors. this code might need a tweak to allow this when routing errors occur.
- I get the following error when i comment out this line https://github.com/joomdev/Astroid-Framework/blob/430dccb7bb8bb99b6de6e76e83c079d16389d5bc/astroid/astroid-template-zero/error.php#L10
Error: Return value of Astroid\Framework::getDocument() must be an instance of Astroid\Document, null returned: Class 'QwupdateserverRouterRulesLegacy' not foundIgnore the class name, it was just one that I was using. This shows it is an issue with routing and commenting this line out allows you to see the error. - The class name needs capitalizing https://github.com/joomdev/Astroid-Framework/blob/430dccb7bb8bb99b6de6e76e83c079d16389d5bc/astroid/astroid-framework/plugins/astroid/astroid.php#L22
- am using Astroid v2.4.2 and Joomla 3.9.22