New theme is not working in Respond 6 cms - themes

I copied a out of the box "material" theme and created my new theme based on the same.
it gets displayed in list when I am trying to create a new website. but when I select a theme and click on "Create" site it gives me an error.
Lumene error log looks like below:
[2016-10-22 06:44:57] lumen.ERROR: exception 'ErrorException' with message 'Undefined variable: main_content' in C:\xampp\htdocs\respond\app\app\Respond\Models\Page.php:652
I already created a html tag main in my page and also one div which having role="main" but it seems I am still missing something.
can someone guide me for looking at correct issue.
Stacktrace is here :
[2016-10-22 06:47:31] lumen.ERROR: exception 'ErrorException' with message 'Undefined variable: main_content' in C:\xampp\htdocs\respond\app\app\Respond\Models\Page.php:652
Stack trace:
0 C:\xampp\htdocs\respond\app\app\Respond\Models\Page.php(652): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(8, 'Undefined varia...', 'C:\\xampp\\htdocs...', 652, Array)
1 C:\xampp\htdocs\respond\app\app\Respond\Models\Page.php(507): App\Respond\Models\Page::refreshJSON(Object(App\Respond\Models\User), Object(App\Respond\Models\Site))
2 C:\xampp\htdocs\respond\app\app\Respond\Libraries\Publish.php(167): App\Respond\Models\Page::listAll(Object(App\Respond\Models\User), Object(App\Respond\Models\Site))
3 C:\xampp\htdocs\respond\app\app\Respond\Models\Site.php(162): App\Respond\Libraries\Publish::publishPlugins(Object(App\Respond\Models\User), Object(App\Respond\Models\Site))
4 C:\xampp\htdocs\respond\app\app\Http\Controllers\SiteController.php(44): App\Respond\Models\Site::create('manual9', '/template', 'mygalaxy.shaile...', 'shailesh')
5 [internal function]: App\Http\Controllers\SiteController->create(Object(Illuminate\Http\Request))
6 C:\xampp\htdocs\respond\app\vendor\illuminate\container\Container.php(507): call_user_func_array(Array, Array)
7 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(593): Illuminate\Container\Container->call(Array, Array)
8 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(560): Laravel\Lumen\Application->callControllerCallable(Array, Array)
9 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(533): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\SiteController), 'create', Array)
10 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(501): Laravel\Lumen\Application->callControllerAction(Array)
11 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(486): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
12 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(383): Laravel\Lumen\Application->handleFoundRoute(Array)
13 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(636): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
14 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(389): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
15 C:\xampp\htdocs\respond\app\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(334): Laravel\Lumen\Application->dispatch(NULL)
16 C:\xampp\htdocs\respond\app\public\index.php(28): Laravel\Lumen\Application->run()
17 {main}

Related

Laravel encrypt error

I'm moving a Laravel App to another server, and did this:
Copied everything to the new server.
Updated the database.php file.
Changed all occurrences of yield to _yield.
But now I'm stuck with a "Server Error: 500 (Internal Server Error)".
After a long weekend fighting with Laravel, I found where to turn on the logs and display errors. And this is what it shows:
Unhandled Exception
Message:
mcrypt_encrypt(): Key of size 22 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported Location:
/home3/l7o1c5g8/public_html/laravel/crypter.php on line 40 Stack Trace:
#0 /home3/l7o1c5g8/public_html/laravel/laravel.php(40): Laravel\Error::native(2, 'mcrypt_encrypt(...', '/home3/l7o1c5g8...', 40)
#1 [internal function]: Laravel{closure}(2, 'mcrypt_encrypt(...', '/home3/l7o1c5g8...', 40, Array)
#2 /home3/l7o1c5g8/public_html/laravel/crypter.php(40): mcrypt_encrypt('rijndael-256', 'YourSecretKeyGo...', 'a:3:{s:2:"id";s...', 'cbc', '5E\x9B ]\xBE\x97Yb\x98J\xD7|\xCA\x90...')
#3 /home3/l7o1c5g8/public_html/laravel/session/drivers/cookie.php(40): Laravel\Crypter::encrypt('a:3:{s:2:"id";s...')
#4 /home3/l7o1c5g8/public_html/laravel/session/payload.php(293): Laravel\Session\Drivers\Cookie->save(Array, Array, false)
#5 [internal function]: Laravel\Session\Payload->save()
#6 /home3/l7o1c5g8/public_html/laravel/session.php(150): call_user_func_array(Array, Array)
#7 /home3/l7o1c5g8/public_html/laravel/laravel.php(193): Laravel\Session::__callStatic('save', Array)
#8 /home3/l7o1c5g8/public_html/laravel/laravel.php(193): Laravel\Session::save()
#9 /home3/l7o1c5g8/public_html/public/index.php(34): require('/home3/l7o1c5g8...')
#10 {main}
Any clue? Should I need to regenerate an encryption code? How?
No idea what to do now.
Using Laravel 3 in a shared hosting.
SOLVED: I changed the default key on /public_html/application/config/application.php
from: 'key' => 'YourSecretKeyGoesHere!',
to: 'key' => '32 characters!',
you must replace the default key with a 16,24 or 32 characters word.
Thank you for your help.

Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists

I'm running into a problem on our backend part of Magento (/admin). It throws up an error:
Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists
It creates a report with the following content:
a:5:{i:0;s:74:"Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists";i:1;s:1693:"#0 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(224): Mage::throwException('Mage registry k...')
1 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(478): Mage::register('_singleton/Mage...', false)
2 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage::getSingleton('Mage_Core_Model...')
3 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(449): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
4 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
5 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
6 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
7 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('login')
8 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
9 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
10 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(685): Mage_Core_Model_App->run(Array)
11 /home/kfrijters/domains/wijnmaat.nl/public_html/index.php(87): Mage::run('', 'store')
12 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}
Does anyone know how to resolve this?

Laravel VerifyCsrfToken.php line 53 random on posts

I'm getting an 500 error from server randomly with some (not all!) post requests. After that error, I have to login.
I implemented PDF2HtmlEX that create html pages made with elements and resources like web fonts.
To change page I make a post and get the data but after some page (not always the same) the ajax post return 500 and inside the data (and the log) I see the error:
[2015-12-21 22:17:48] local.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:53
Stack trace:
#0 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#1 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#2 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#3 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#4 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#5 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#6 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#7 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#8 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#9 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#10 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#11 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#14 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#17 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#19 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#20 /path/to/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#21 /path/to/laravel-project/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#22 {main}
Like explaned in the documentation, I add...
<meta name="csrf-token" content="{{ csrf_token() }}">
in the app.blade.php master view templates.
And at the start of js script I add:
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
I googled a lot and searched inside stackoverflow but I can't figure it out!
The problem is that the error is occurring somethimes, not always: seems like there is a limit of checks that the token is considered valid.
I use ajax, so the meta tag with token never change across posts.
I'm using laravel 5.1 (5.0 upgraded).
EDIT 1:
I tried to increase 'lifetime' => 120, value inside project/config/session.php: if the value is low (tried 10) I can get this error on 2nd or 3rd post (after 10-20 secs), if the value is hight (tried 9999) I get this error on 30th+ post requests (after 4-5 minutes).
EDIT 2:
I add some log inside the controller and middleware.
I can see all the get requests return correct values, the post error, the other get files started after the post that have the same token inside the ajax header of the post.
I can't see the log of the method of controller that serve post request:
routes.php:
Route::post('/page', "RController#rPageData");
RController.php:
public function rPageData(){
Log::info("I am there!"); # always showed except when error occurred.
# ... other code ...
}
EDIT 3:
More infos: I dumped out $request from a correct post in RController::rPageData(), and a error post request from the Exception handler.
I see that the first 2 lines, userResolver and routeResolver, are null in error post, and well done in correct post. Seems like user is not authenticated, but the nexts GET request, like reported in my EDIT 2, are made correctly.
Error post:
Request {#40 ▼
#json: null
#userResolver: null
#routeResolver: null
...
Good post:
Request {#40 ▼
#json: null
#userResolver: Closure {#144 ▶}
#routeResolver: Closure {#154 ▶}
...
Inside the Request > cookies > headers > parameters > XSRF-TOKEN I have the same token in the 2 posts.
Inside the Request > session > attributes > _token, I have 2 different token in the 2 posts.
EDIT 4:
Well, if you put session_start(); at the top of your routes.php, after <?php tag, it will work.
NOTE: this is not the solution. GrahamCampbell (the second biggest Laravel contributor) said:
NEVER do that! Because that's totally incorrect.
Attach reference
Have you any suggestions?
Thank you in advance!
By default, sessions last 2 hours in Laravel. When they begin to fail have you refreshed the page within 2 hours?
You can increase the length of time sessions will be valid for in config/session.php:
'lifetime' => 120 //120 minutes is 2 hours

Magento 1.7 Index Error on product description update

when trying to update Magento 1.7 product descriptions, we get the following error message:
Fatal error: Uncaught exception 'Exception' with message '
Warning: Invalid argument supplied for foreach()
in /app/code/core/Mage/Index/Model/Event.php on line 167'
in /app/code/core/Mage/Core/functions.php:245
Stack trace:
#0 /app/code/core/Mage/Index/Model/Event.php(167): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/magent...', 167, Array)
#1 /app/code/core/Mage/Index/Model/Event.php(199): Mage_Index_Model_Event->_mergeNewDataRecursive(false, Array)
#2 /app/code/core/Mage/Index/Model/Resource/Event.php(67): Mage_Index_Model_Event->mergePreviousData(Array)
#3 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(423): Mage_Index_Model_Resource_Event->_beforeSave(Object(Mage_Index_Model_Event))
#4 /app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Mode in /app/code/core/Mage/Core/functions.php on line 245
Any ideas, what is going wrong?
Thanks for your help
Matthias
I had the same problem, using a wrong store id.
Mage::app()->setCurrentStore(1);

Receiving "Query was empty" error when loading log visitor collection in Magento

How does one retrieve a collection of visitors using the Log/Visitor model? I've tried using the following code....
<?php
error_reporting(E_ALL);
ini_set('display_errors',TRUE);
$root = $_SERVER['DOCUMENT_ROOT'];
require_once $root.'/app/Mage.php';
Mage::app('default');
$visitors = Mage::getModel('log/visitor')->getCollection()->load();
?>
But it returns an error, an excerpt from which is...
SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty
The query doesn't throw any errors until I add the 'load()' method to the chain. My question is similar to magento visitor logs, but that code example was missing the load() and the only answer resorted to using the resource model directly, which I don't think should be necessary.
Update:
Magento version being used is 1.4.1.1. Full exception trace:
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty' in /home/dev_fluid/public_html/lib/Zend/Db/Statement/Pdo.php:234 Stack trace: #0 /home/dev_fluid/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array) #2 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('', Array) #3 /home/dev_fluid/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('', Array) #4 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Abstract.php(706): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array) #5 /home/dev_fluid/public_html/lib/Varien/Data/Collection/Db.php(707): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array) #6 /home/dev_fluid/public_html/lib/Varien/Data/Collection/Db.php(620): Varien_Data_Collect in /home/dev_fluid/public_html/lib/Zend/Db/Statement/Pdo.php on line 234
New trace, using's Jurgen's getTraceAsString() approach:
#0 /home/dev_fluid/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('', Array)
#3 /home/dev_fluid/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('', Array)
#4 /home/dev_fluid/public_html/lib/Zend/Db/Adapter/Abstract.php(706): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /home/dev_fluid/public_html/lib/Varien/Data/Collection/Db.php(707): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array)
#6 /home/dev_fluid/public_html/lib/Varien/Data/Collection/Db.php(620): Varien_Data_Collection_Db->_fetchAll(Object(Varien_Db_Select))
#7 /home/dev_fluid/public_html/lib/Varien/Data/Collection/Db.php(590): Varien_Data_Collection_Db->getData()
#8 /home/dev_fluid/public_html/app/code/core/Mage/Log/Model/Mysql4/Visitor/Collection.php(300): Varien_Data_Collection_Db->load(false, false)
#9 /home/dev_fluid/public_html/andy/visitor.php(11): Mage_Log_Model_Mysql4_Visitor_Collection->load()
#10 {main}
Please change your code to:
<?php
error_reporting(E_ALL);
ini_set('display_errors',TRUE);
$root = $_SERVER['DOCUMENT_ROOT'];
require_once $root.'/app/Mage.php';
Mage::app('default');
$visitors = Mage::getModel('log/visitor')->getCollection();
try {
$x = $visitors->load();
die('no exception');
}
catch (Exception $e) {
var_dump($e->getTraceAsString());
}
If the exception occurs within the load() method, this should give you a full trace.
If that trace doesn't help you to pin down the issue, I'd recommend to use a PHP debugger like xdebug, or Zend Debug, or DBG, etc. (depending on what debugger your IDE supports).
Setting a breakpoint right before the load() method and single stepping thru the code should show give you a clue, why the query is empty.

Resources