1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Bss_CreateMenuBackend::helloworld.phtml' in module: 'Magento_Backend' block's name: 'content_schedule_block1'
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Bss_CreateMenuBackend::helloworld.phtml' in module: 'Magento_Backend' block's name: 'content_schedule_block1'
#1 Magento\Framework\View\Element\Template->_toHtml() called at [vendor\magento\module-backend\Block\Template.php:129]
#2 Magento\Backend\Block\Template->_toHtml() called at [vendor\magento\framework\View\Element\AbstractBlock.php:1097]
#3 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor\magento\framework\View\Element\AbstractBlock.php:1101]
#4 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor\magento\framework\View\Element\AbstractBlock.php:671]
#5 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor\magento\framework\View\Layout.php:557]
#6 Magento\Framework\View\Layout->_renderBlock('content_schedule...') called at [vendor\magento\framework\View\Layout.php:533]
#7 Magento\Framework\View\Layout->renderNonCachedElement('content_schedule...') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#8 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content_schedule...') called at [vendor\magento\framework\View\Layout.php:488]
#9 Magento\Framework\View\Layout->renderElement('content_schedule...', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#10 Magento\Framework\View\Layout\Interceptor->renderElement('content_schedule...', false) called at [vendor\magento\framework\View\Layout.php:585]
#11 Magento\Framework\View\Layout->_renderContainer('content', false) called at [vendor\magento\framework\View\Layout.php:535]
#12 Magento\Framework\View\Layout->renderNonCachedElement('content') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#13 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content') called at [vendor\magento\framework\View\Layout.php:488]
#14 Magento\Framework\View\Layout->renderElement('content', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#15 Magento\Framework\View\Layout\Interceptor->renderElement('content', false) called at [vendor\magento\framework\View\Layout.php:585]
#16 Magento\Framework\View\Layout->_renderContainer('main.col', false) called at [vendor\magento\framework\View\Layout.php:535]
#17 Magento\Framework\View\Layout->renderNonCachedElement('main.col') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#18 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.col') called at [vendor\magento\framework\View\Layout.php:488]
#19 Magento\Framework\View\Layout->renderElement('main.col', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#20 Magento\Framework\View\Layout\Interceptor->renderElement('main.col', false) called at [vendor\magento\framework\View\Layout.php:585]
#21 Magento\Framework\View\Layout->_renderContainer('admin.scope.col....', false) called at [vendor\magento\framework\View\Layout.php:535]
#22 Magento\Framework\View\Layout->renderNonCachedElement('admin.scope.col....') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#23 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('admin.scope.col....') called at [vendor\magento\framework\View\Layout.php:488]
#24 Magento\Framework\View\Layout->renderElement('admin.scope.col....', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#25 Magento\Framework\View\Layout\Interceptor->renderElement('admin.scope.col....', false) called at [vendor\magento\framework\View\Layout.php:585]
#26 Magento\Framework\View\Layout->_renderContainer('page.main.contai...', false) called at [vendor\magento\framework\View\Layout.php:535]
#27 Magento\Framework\View\Layout->renderNonCachedElement('page.main.contai...') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#28 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.main.contai...') called at [vendor\magento\framework\View\Layout.php:488]
#29 Magento\Framework\View\Layout->renderElement('page.main.contai...', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#30 Magento\Framework\View\Layout\Interceptor->renderElement('page.main.contai...', false) called at [vendor\magento\framework\View\Layout.php:585]
#31 Magento\Framework\View\Layout->_renderContainer('page.content', false) called at [vendor\magento\framework\View\Layout.php:535]
#32 Magento\Framework\View\Layout->renderNonCachedElement('page.content') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#33 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.content') called at [vendor\magento\framework\View\Layout.php:488]
#34 Magento\Framework\View\Layout->renderElement('page.content', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#35 Magento\Framework\View\Layout\Interceptor->renderElement('page.content', false) called at [vendor\magento\framework\View\Layout.php:585]
#36 Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) called at [vendor\magento\framework\View\Layout.php:535]
#37 Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#38 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') called at [vendor\magento\framework\View\Layout.php:488]
#39 Magento\Framework\View\Layout->renderElement('page.wrapper', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#40 Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false) called at [vendor\magento\framework\View\Layout.php:585]
#41 Magento\Framework\View\Layout->_renderContainer('backend.page', false) called at [vendor\magento\framework\View\Layout.php:535]
#42 Magento\Framework\View\Layout->renderNonCachedElement('backend.page') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#43 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('backend.page') called at [vendor\magento\framework\View\Layout.php:488]
#44 Magento\Framework\View\Layout->renderElement('backend.page', false) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#45 Magento\Framework\View\Layout\Interceptor->renderElement('backend.page', false) called at [vendor\magento\framework\View\Layout.php:585]
#46 Magento\Framework\View\Layout->_renderContainer('root', false) called at [vendor\magento\framework\View\Layout.php:535]
#47 Magento\Framework\View\Layout->renderNonCachedElement('root') called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:206]
#48 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root') called at [vendor\magento\framework\View\Layout.php:488]
#49 Magento\Framework\View\Layout->renderElement('root', true) called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:193]
#50 Magento\Framework\View\Layout\Interceptor->renderElement('root') called at [vendor\magento\framework\View\Layout.php:954]
#51 Magento\Framework\View\Layout->getOutput() called at [generated\code\Magento\Framework\View\Layout\Interceptor.php:492]
#52 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor\magento\framework\View\Result\Page.php:258]
#53 Magento\Framework\View\Result\Page->render(&Magento\Framework\App\Response\Http\Interceptor#000000005a145ea0000000002a77c2a8#) called at [vendor\magento\framework\View\Result\Layout.php:171]
#54 Magento\Framework\View\Result\Layout->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000005a145ea0000000002a77c2a8#) called at [generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php:193]
#55 Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000005a145ea0000000002a77c2a8#) called at [vendor\magento\framework\App\Http.php:141]
#56 Magento\Framework\App\Http->launch() called at [generated\code\Magento\Framework\App\Http\Interceptor.php:24]
#57 Magento\Framework\App\Http\Interceptor->launch() called at [vendor\magento\framework\App\Bootstrap.php:261]
#58 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000005a145eab000000002a77c2a8#) called at [index.php:39]
check the file is available on path and check code is valid as per php and html stucture:
app/code/Bss/CreateMenuBackend/view/adminhtml/templates/helloworld.phtml
which is specified in layout file with block name "content_schedule_block1"
The example is wrong. You should follow this doc: https://devdocs.magento.com/guides/v2.4/ext-best-practices/extension-coding/example-module-adminpage.html.
If you want to fix it. You only need to change resource="Magento_Backend" in menu.xml.
Related
I am getting 500 internal server error after deploying laravel app to shared hosting. The main page is working only. When I click on other pages link on navbar of main page I get the error.
I am pasting error logs, it may help
#18 /home/sham/auction/app/Providers/AppServiceProvider.php(28): Illuminate\\Database\\Eloquent\\Builder->get()
#19 [internal function]: App\\Providers\\AppServiceProvider->boot()
#20 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#21 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#22 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#23 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#24 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#25 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(856): Illuminate\\Container\\Container->call(Array)
#26 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(839): Illuminate\\Foundation\\Application->bootProvider(Object(App\\Providers\\AppServiceProvider))
#27 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(App\\Providers\\AppServiceProvider), 20)
#28 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(840): array_walk(Array, Object(Closure))
#29 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#30 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(219): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#31 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(156): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#32 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\\Foundation\\Http\\Kernel->bootstrap()
#33 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#34 /home/sham/public_html/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#35 {main}
AppServiceProvider boot method
public function boot()
{
$categories = Category::take(10)->latest()->get();
View::share('categories', $categories);
}
You need to read the error.
The top line is telling you that the error is in the file home/shamcgav/auction/app/Providers/AppServiceProvider.php on line 28.
Specifically something went wrong with a call to Illuminate\\Database\\Eloquent\\Builder->get().
If you can find a call to ->get() on a database query on line 28 of AppServiceProvider.php, you will hopefully see an error. If you are unable to find the error, post the content of that file here!
We have to get the latest data, then we get the first 10 elements. So the code is as follows:
public function boot()
{
$categories = Category::latest()->take(10)->get();
View::share('categories', $categories);
}
I've found many posts regarding putting controllers in sub folders, Most if not all seem to be related to namespace or naming issues. I just cant seem to get it working, and keep getting the following ReflectionException and FatalError Reporting the class is in use.
[2016-12-22 16:51:13] local.ERROR: ReflectionException: Class App\Http\Controllers\Admin\DashboardController does not exist in /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Container/Container.php:749
Stack trace:
#0 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Container/Container.php(749): ReflectionClass->__construct('App\\Http\\Contro...')
#1 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Container/Container.php(644): Illuminate\Container\Container->build('App\\Http\\Contro...', Array)
#2 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\Container\Container->make('App\\Http\\Contro...', Array)
#3 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Foundation\Application->make('App\\Http\\Contro...')
#4 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Route.php(316): Illuminate\Routing\Route->getController()
#5 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Route.php(278): Illuminate\Routing\Route->controllerMiddleware()
#6 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(655): Illuminate\Routing\Route->gatherMiddleware()
#7 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->gatherRouteMiddleware(Object(Illuminate\Routing\Route))
#8 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(618): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#9 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(596): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#10 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(267): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#12 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#13 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#16 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#17 /vagrant/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#18 /vagrant/myApp/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#19 {main}
[2016-12-22 16:51:13] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Cannot declare class App\Http\Controller\Admin\DashboardController, because the name is already in use in /vagrant/myApp/app/Http/Controllers/Admin/DashboardController.php:0
Stack trace:
#0 {main}
I have tried using different class names, that didn't solve anything. As long as I route to a controller in the Admin folder/namespace I get the listed error. I have ran composer dump-autoload after every change and ran php artisan cache:clear just to be safe
My Folder Structure
/app/
Console/
Exceptions/
Http/
Controllers/
Admin/
DashboardController.php
Auth/
Controller.php
...OtherController.php files live here in the base Controller folder
Middleware/
Providers/
/routes/web.php
...
// Admin Routes
Route::group( [ 'namespace' => 'Admin','prefix' => 'admin' ], function(){
Route::get( '/', 'DashboardController#showAdminHome' )->name( 'admin.dashboard' );
});
/app/Http/Controllers/Admin/DashboardController.php
<?php
namespace App\Http\Controller\Admin;
use App\Http\Controllers\Controller;
class DashboardController extends Controller {
public function showAdminHome() {
return view( 'admin.dashboard' );
}
} //- END Admin\DashboardController{}
I've ran out of things to try and appreciate any help.
You need to use correct namespace to fix the error:
namespace App\Http\Controllers\Admin;
Check your namespace also add full path in namespace.
namespace App\Http\Controllers\Admin;
I am trying the extend the enterprise's block of GoogleAnalyticsUniversal module. All went fine. I have also added my custom template through layout file as below.
<layout version="0.1.0">
<default>
<!-- Remove Mage_GoogleAnalytics -->
<remove name="google_analytics" />
<reference name="head">
<action method="addJs" ifconfig="google/analytics/active"><script>google/ga.js</script></action>
</reference>
<reference name="after_body_start">
<reference name="content">
<block type="Test_Googleanalyticsuniversal/Ga" name="google_analyticsuniversal" as="google_analyticsuniversal"
template="googleanalyticsuniversal/ga.phtml" />
</reference>
</reference>
</default>
</layout>
My Config.xml as:
<config>
<modules>
<Test_Googleanalyticsuniversal>
<version>0.0.1</version>
</Test_Googleanalyticsuniversal>
<depends>
<Enterprise_GoogleAnalyticsUniversal />
</depends>
</modules>
<global>
<helpers>
<enterprise_googleanalyticsuniversal>
<rewrite>
<data>Test_Googleanalyticsuniversal_Helper_Data</data>
</rewrite>
</enterprise_googleanalyticsuniversal>
</helpers>
<blocks>
<test_googleanalyticsuniversal>
<class>Test_Googleanalyticsuniversal_Block</class>
</test_googleanalyticsuniversal>
<enterprise_googleanalyticsuniversal>
<rewrite>
<ga>Test_Googleanalyticsuniversal_Block_Ga</ga>
</rewrite>
</enterprise_googleanalyticsuniversal>
</blocks>
</global>
<frontend>
<layout>
<updates>
<test_googleanalyticsuniversal>
<file>googleanalyticsuniversal.xml</file>
</test_googleanalyticsuniversal>
</updates>
</layout>
</frontend>
</config>
My block Ga.php as:
class Test_Googleanalyticsuniversal_Block_Ga extends Enterprise_GoogleAnalyticsUniversal_Block_Ga
{
protected function _getContainerSnippet()
{
// Get the container ID.
$containerId = Mage::helper('googleanalyticsuniversal')->isTagManagerId();
// Render the container snippet JavaScript.
return "<noscript><iframe src=\"//www.googletagmanager.com/ns.html?id=".$containerId."\"
height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','".$containerId."');</script>\n";
}
/**
* Generate JavaScript for the data layer.
*
* #return string|null
*/
protected function _getDataLayer()
{
// Initialise our data source.
$data = array();
$data = $data;
// Enable modules to add custom data to the data layer
$data_layer = new Varien_Object();
$data_layer->setData($data);
$data = $data_layer->getData();
// Generate the data layer JavaScript.
if (!empty($data)) return "<script>dataLayer = [".json_encode($data)."];</script>\n\n";
else return '';
}
}
But when I run the frontend, it gives the following error in Exception.log..
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Test_Googleanalyticsuniversal_Block_Ga' in /var/www/tbstr-dev/html/app/Mage.php:595
Stack trace:
#0 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('Alshaya_Googlea...', Array)
#2 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('Alshaya_Googlea...', 'google_analytic...')
#3 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('Alshaya_Googlea...', 'google_analytic...')
#4 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#7 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#8 /var/www/tbstr-dev/html/app/code/core/Mage/Catalog/controllers/CategoryController.php(148): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#9 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#10 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#11 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /var/www/tbstr-dev/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /var/www/tbstr-dev/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#14 /var/www/tbstr-dev/html/index.php(83): Mage::run('', 'store')
#15 {main}
In log, it is adding extra Mage keyword before the Test_Googleanalyticsuniversal_Block_Ga as Mage_Test_Googleanalyticsuniversal_Block_Ga...
I have tried modifying the layout block type in googleanalytics.xml to many different methods. But nothing worked out. So can anyone suggest me on this.
I'm trying to call my block from magento cms static block, but it doesn't work.
local/Mymodule/Test/etc/config.xml
<config>
<modules>
<Mymodule_Test>
<version>1.0.0</version>
</Mymodule_Test>
</modules>
<global>
<blocks>
<test>
<class>Mymodule_Test_Block</class>
</test>
</blocks>
</global>
</config>
local/Mymodule/Test/Block/Testblock.php
class Mymodule_Test_Block_Testblock extends Mage_Core_Block_Template
{
}
In my static cms page i use
{{block type="test/testblock" template="page/test.phtml"}}
I'm assuming that the block template is placed correctly bcus when I call
{{block type="core/template" template="page/test.phtml"}}
this works without problem.
error.log
2016-05-04T12:43:51+00:00 ERR (3):
exception 'Exception' with message 'Notice: Undefined variable: block in C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Model\Email\Template\Filter.php on line 187' in C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\functions.php:245
Stack trace:
#0 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Model\Email\Template\Filter.php(187): mageCoreErrorHandler(8, 'Undefined varia...', 'C:\\xampp5-6-14\\...', 187, Array)
#1 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#2 C:\xampp5-6-14\htdocs\project\lib\Varien\Filter\Template.php(163): call_user_func(Array, Array)
#3 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Model\Email\Template\Filter.php(558): Varien_Filter_Template->filter('<p>{{block type...')
#4 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Cms\Block\Page.php(101): Mage_Core_Model_Email_Template_Filter->filter('<p>{{block type...')
#5 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Cms_Block_Page->_toHtml()
#6 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#7 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(577): Mage_Core_Block_Abstract->_getChildHtml('cms_page', true)
#8 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Page\Block\Html\Wrapper.php(52): Mage_Core_Block_Abstract->getChildHtml('', true, true)
#9 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Page_Block_Html_Wrapper->_toHtml()
#10 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
#11 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#12 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#13 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#14 C:\xampp5-6-14\htdocs\project\app\design\frontend\mydesign\system\template\page\1column.phtml(55): Mage_Core_Block_Abstract->getChildHtml('content')
#15 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Template.php(241): include('C:\\xampp5-6-14\\...')
#16 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template->fetchView('frontend\\myde...')
#17 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()
#18 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#19 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#20 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout->getOutput()
#21 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Cms\Helper\Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#22 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#23 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Cms\controllers\IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#24 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Cms_IndexController->indexAction()
#25 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#26 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#27 C:\xampp5-6-14\htdocs\project\app\code\core\Mage\Core\Model\App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#28 C:\xampp5-6-14\htdocs\project\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#29 C:\xampp5-6-14\htdocs\project\index.php(102): Mage::run('', 'store')
#30 {main}
Any ides why is email template filter even being called ?
This is for Magento Enterpise, but for some reason I can't add the tag :v
I found similar problem with probably correct solution - check this:
https://tomlankhorst.nl/fix-magento-1-9-2-2-notice-undefined-variable-block/
TLDR:
Go to the Backend > System > Permissions > Blocks
Add the block you like - eg. test/testblock (allowed)
Ready!
There has been an error processing your request
Mage registry key "_singleton/callforprice/observer" already exists
Admin is not opening frontend is not opening what happend to my site?
Trace:
#0 /home/chhabraa/public_html/beta/app/Mage.php(224): Mage::throwException('Mage registry k...')
#1 /home/chhabraa/public_html/beta/app/Mage.php(478): Mage::register('_singleton/call...', false)
#2 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_App.php(1316): Mage::getSingleton('callforprice/ob...')
#3 /home/chhabraa/public_html/beta/app/Mage.php(449): Mage_Core_Model_App->dispatchEvent('core_block_abst...', Array)
#4 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Block_Abstract.php(292): Mage::dispatchEvent('core_block_abst...', Array)
#5 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#6 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_Layout.php(472): Mage_Core_Model_Layout->createBlock('page/html', 'root')
#7 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_Layout.php(239): Mage_Core_Model_Layout->addBlock('page/html', 'root')
#8 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#9 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Controller_Varien_Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#10 /home/chhabraa/public_html/beta/includes/src/Mage_Cms_Helper_Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#11 /home/chhabraa/public_html/beta/includes/src/Mage_Cms_Helper_Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#12 /home/chhabraa/public_html/beta/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#13 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Controller_Varien_Action.php(418): Mage_Cms_IndexController->indexAction()
#14 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Controller_Varien_Router_Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#15 /home/chhabraa/public_html/beta/includes/src/BalkeTechnologies_StoreMaintenance_Controller_Router_Standard.php(91): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Controller_Varien_Front.php(172): BalkeTechnologies_StoreMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /home/chhabraa/public_html/beta/includes/src/Mage_Core_Model_App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 /home/chhabraa/public_html/beta/app/Mage.php(685): Mage_Core_Model_App->run(Array)
#19 /home/chhabraa/public_html/beta/index.php(96): Mage::run('', 'store')
#20 {main}
Error log record number: 591000213289
This error shows up in app/Mage.php class in the method register.
You have somewhere in your code used this method to register the same key more than once.
If you check the method:
public static function register($key, $value, $graceful = false)
You must set the third parameter $graceful to be true so it doesn't throw an exception like this:
Mage::register($key, $value, true);