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);
Related
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.
Parse error: Invalid numeric literal in C:\xampp\htdocs\aecollegealumni.com\application\config\constants.php on line 43
in constant file i have define('std',021)
and showing above error. i am using xammp server 3.2.2, php 7.1.1 and apache 2.4
can you please help me
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\aecollegealumni.com\system\database\drivers\mysql\mysql_driver.php:74 Stack trace: #0 C:\xampp\htdocs\aecollegealumni.com\system\database\DB_driver.php(231): CI_DB_mysql_driver->db_connect() #1 C:\xampp\htdocs\aecollegealumni.com\system\database\DB.php(297): CI_DB_driver->initialize() #2 C:\xampp\htdocs\aecollegealumni.com\application\core\MY_Loader.php(43): DB(Array, NULL) #3 C:\xampp\htdocs\aecollegealumni.com\system\core\Loader.php(2343): MY_Loader->database() #4 C:\xampp\htdocs\aecollegealumni.com\system\core\Loader.php(305): CI_Loader->_ci_autoloader() #5 C:\xampp\htdocs\aecollegealumni.com\application\third_party\MX\Loader.php(123): CI_Loader->initialize() #6 C:\xampp\htdocs\aecollegealumni.com\system\core\Controller.php(103): MX_Loader->initialize() #7 C:\xampp\htdocs\aecollegealumni.com\application\controllers\home.php(6): CI_Controller->__construct() #8 C:\xampp\htdocs\aecollegealumni.com\system\core\CodeIgniter.php(617): H in C:\xampp\htdocs\aecollegealumni.com\system\database\drivers\mysql\mysql_driver.php on line 74
Change
$db['default']['dbdriver'] = 'mysql';
to
$db['default']['dbdriver'] = 'mysqli';
When I run phpunit on the command promp, there exist error like this :
Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1076
Stack trace:
#0 C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1076
PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1076
Stack trace:
#0 C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1076
I want to test event to send email is working or not
How can I solve it?
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}
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.