I am starting to use a dart API for d3.js (found here: https://pub.dartlang.org/packages/d3) and I came across a problem, when I tried to create a Axis using TimeScale.
Console:
oSuchMethodError: method not found: '_proxy'
Receiver: Instance of 'TimeScale'
Arguments: []
timeline.dart code
x = new time.TimeScale()
..range([0, width])
..domain([new DateTime(1999, 0, 1), new DateTime(2014, 0, 0)]);
x = new svg.Axis()
..scale(x);
Log:
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:44)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
#2 getProxy (package:d3/src/js/scale.dart:679:31)
#3 Axis.scale (package:d3/src/js/svg.dart:867:16)
#4 Timeline.attached (http://localhost:20080/frontend/dart/components/timeline.dart:29:9)
#5 Application.init.<init_async_body>.<anonymous closure> (http://localhost:20080/frontend/dart/application/application.dart:128:25)
#6 _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:351)
#7 Application.init.<init_async_body> (http://localhost:20080/frontend/dart/application/application.dart:105:37)
#8 Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#9 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#10 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#11 _ScheduleImmediateHelper._handleMutation (dart:html:49308)
[[class]]: _StackTrace(anonymous function) # VM2334:1
VM2334:1 Uncaught Unhandled exception:
Closure call with mismatched arguments: function '_proxy'
NoSuchMethodError: method not found: '_proxy'
Receiver: Instance of 'TimeScale'
Arguments: []
#0 Application.init.<init_async_body>.<anonymous closure> (http://localhost:20080/frontend/dart/application/application.dart:131:21)
#1 _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:351)
#2 Application.init.<init_async_body> (http://localhost:20080/frontend/dart/application/application.dart:105:37)
#3 Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#4 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#5 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#6 _ScheduleImmediateHelper._handleMutation (dart:html:49308)(anonymous function) # VM2334:1
d3/src/js/scale.dart - line 679
JsObject getProxy(arg) => arg._proxy;
d3/src/js/svg.dart
scale([scale = undefined]) {
var args = [];
if (scale != undefined) {
//line 867
args.add(sc.getProxy(scale));
}
var retval = _proxy.callMethod('scale', args);
if (scale == undefined) {
return retval; // TODO: wrap in Scale
} else {
return new Axis._(retval);
}
}
Did anyone know what's wrong ?
Thanks
Looking at the package code, you will only be able to give a scale parameter that belong to d3/src/js/scale.dart library.
Using a private member like in arg._proxy will retrieve the _proxy attribute only for arg inside the same library (that's what the prepending _ means : private to its library).
Unfortunately I don't see any simple solution to workaround your issue with the current package sources.
Related
Why I get this error when set from Config/Boot/production.php CI_DEBUG to false in production mode ? this is the default setting from CI4.
defined('CI_DEBUG') || define('CI_DEBUG', false);
Fatal error: Declaration of CodeIgniter\Log\Logger::emergency($message, array $context = []): bool must be compatible with Psr\Log\LoggerInterface::emergency(Stringable|string $message, array $context = []): void in E:\testing\Source Code\testing_CI_v.4.2.6\system\Log\Logger.php on line 157
Fatal error: Uncaught Error: Class "CodeIgniter\Log\Logger" not found in E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\Services.php:391 Stack trace: #0 E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\BaseService.php(253): CodeIgniter\Config\Services::logger(false) #1 E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\BaseService.php(194): CodeIgniter\Config\BaseService::__callStatic('logger', Array) #2 E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\Services.php(388): CodeIgniter\Config\BaseService::getSharedInstance('logger') #3 E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\BaseService.php(253): CodeIgniter\Config\Services::logger(true) #4 E:\testing\Source Code\testing_CI_v.4.2.6\system\Common.php(799): CodeIgniter\Config\BaseService::__callStatic('logger', Array) #5 E:\testing\Source Code\testing_CI_v.4.2.6\system\Debug\Exceptions.php(114): log_message('critical', '{message}\nin {e...', Array) #6 E:\testing\Source Code\testing_CI_v.4.2.6\system\Debug\Exceptions.php(180): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #7 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler() #8 {main} thrown in E:\testing\Source Code\testing_CI_v.4.2.6\system\Config\Services.php on line 391
For Development And Testing Mode run without problem. This error just occur when using routes->resource (RESTFUL API).
It is not clear what error is this. I try to replace the system folder with new one. But the error still exists.
It is said "Uncaught Error: Class "CodeIgniter\Log\Logger" not found" I don't know what is the problem with this and why it is not found.
Now my app just run with set CI_DEBUG to true to prevent the error. But the default is set to false for production.
defined('CI_DEBUG') || define('CI_DEBUG', true);
What is missing in here ? It is so strange that setting the CI_ENVIRONMENT to development or testing worked without a problem. But for production not working. So I decide to turn on the error display in production mode and found the error above.
Seriously help need.
I found the problem in the restful api.
The problem is in the config/filter.php
$routes->resource('ApiManageTips', ['controller' =>'App\Controllers\ApiData\ApiManageTips']); // get, put, create, delete
public $filters = [
'basicauth' => ['before' =>
[
'ApiManageTips/*',
'ApiManageTips',
]
]
];
The Above example is working in the version 4.1.2 but is not working in version 4.2.6
Instead change to :
public $filters = [
'basicauth' => ['before' =>
[
'ApiManageTips/*',
]
];
I don't why it is not working in the CI Version 4.2.6.
i have moved a Magento installation from a preview system to my local machine for developing and testing.
i have setup the BASE URL to my V-Host in the database.
The frontend works but i cant get into the admin panel.
if i log in, i got the following error message:
No region found within the locale 'de'
Trace:
#0 /var/www/myProjectName/lib/Zend/Currency.php(101): Zend_Currency->setLocale(NULL)
#1 /var/www/myProjectName/app/code/core/Mage/Core/Model/Locale.php(575): Zend_Currency->__construct('USD', NULL)
#2 /var/www/myProjectName/app/code/core/Mage/Directory/Model/Currency.php(233): Mage_Core_Model_Locale->currency('EUR')
#3 /var/www/myProjectName/app/code/core/Mage/Directory/Model/Currency.php(216): Mage_Directory_Model_Currency->formatTxt(NULL, Array)
#4 /var/www/myProjectName/app/code/core/Mage/Directory/Model/Currency.php(197): Mage_Directory_Model_Currency->formatPrecision(NULL, 2, Array, true, false)
#5 /var/www/myProjectName/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php(82): Mage_Directory_Model_Currency->format(NULL)
#6 /var/www/myProjectName/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php(62): Mage_Adminhtml_Block_Dashboard_Bar->format(NULL)
#7 /var/www/myProjectName/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php(74): Mage_Adminhtml_Block_Dashboard_Bar->addTotal('Revenue', NULL)
#8 /var/www/myProjectName/app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Adminhtml_Block_Dashboard_Totals->_prepareLayout()
#9 /var/www/myProjectName/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#10 /var/www/myProjectName/app/code/core/Mage/Adminhtml/Block/Dashboard.php(50): Mage_Core_Model_Layout->createBlock('adminhtml/dashb...')
#11 /var/www/myProjectName/app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Adminhtml_Block_Dashboard->_prepareLayout()
#12 /var/www/myProjectName/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#13 /var/www/myProjectName/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/dashb...', 'dashboard')
#14 /var/www/myProjectName/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/dashb...', 'dashboard')
#15 /var/www/myProjectName/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))
#16 /var/www/myProjectName/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#17 /var/www/myProjectName/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#18 /var/www/myProjectName/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#19 /var/www/myProjectName/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#20 /var/www/myProjectName/app/code/core/Mage/Adminhtml/controllers/DashboardController.php(40): Mage_Adminhtml_Controller_Action->loadLayout()
#21 /var/www/myProjectName/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_DashboardController->indexAction()
#22 /var/www/myProjectName/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#23 /var/www/myProjectName/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#24 /var/www/myProjectName/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#25 /var/www/myProjectName/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#26 /var/www/myProjectName/index.php(87): Mage::run('', 'store')
#27 {main}
Can i set the region anywhere? everything i found with google cant help me out.
Just tell me what else you want to know.
I hope you can help me!
Thanks smo
So basically:
got to core_config_data in your database
and delete the line where path = general
I got the same problem but there was no "general" Config-Entry without any other path and content, so i need to debug the problem a bit deeper.
Btw - you can search the config-entry like this:
SELECT * FROM core_config_data WHERE core_config_data.path = 'general';
To me, it seems to be a Firefox-only Problem and i think, its out of the language-setting from the browser. Its inside the Zend-currency-handling. Only Firefox has the problem - Chrome, Edge, Internet Explorer works well!
So i fixed the Magento-Code like that a bit dirty but it works:
Copy lib/Zend/Currency.php to app/code/local/Zend/Currency.php and edit this.
Now you can overwrite the Zend-Framework file.
Go to the following line at copied:
public function setLocale($locale = null)
#require_once 'Zend/Locale.php';
try {
$locale = Zend_Locale::findLocale($locale);
Add last Line:
public function setLocale($locale = null)
{
#require_once 'Zend/Locale.php';
try {
$locale = Zend_Locale::findLocale($locale);
if ( $locale == 'de' ) $locale = 'de_DE'; // zend fix the firefox-locale error
After that, you can edit the products again!
This Variant is also updateable out of the overwrite-code.
Hope that helps!
It happens that the locale is defined based on your browser locale detection. You can like or not this behavior but in this case that's the reason you have this error message.
To fix that you have to change the priority or switch the locale supported by your browser. What I mean by priority is that the browser provide a list of supported language. For example you may have something like that Accept-Language: da, en-gb;q=0.8, en;q=0.7
In your case it searches de but your browser doesn't support it. So you may use "Quick Locale" for firefox to switch to en-US or de-DE for example to prevent such errors if you use this one or something similar. It's not a but in Magento, it's a wanted behavior I think.
I get this error when I include
$installer->createEntityTables( $this->getTable('red/red') );
I am using enterprise 1.11
I have also seen alternative to that is type every thing which is really time consuming. Could someone please tell me who to make this function work.
[previous:Exception:private] =>
[xdebug_message] => ( ! ) Mage_Eav_Exception: Can't create table: red_faqs_eavexample in C:\wamp\www\ubt.onlocal.com.au\app\Mage.php on line 549
Call Stack
#TimeMemoryFunctionLocation
10.0003690528{main}( )..\index.php:0
20.00271167384Mage::run( )..\index.php:81
30.01012776112Mage_Core_Model_App->run( )..\Mage.php:640
40.02304545784Mage_Core_Model_App->_initModules( )..\App.php:338
50.46364871080Mage_Core_Model_Resource_Setup::applyAllUpdates( )..\App.php:412
60.528411772936Mage_Core_Model_Resource_Setup->applyUpdates( )..\Setup.php:235
70.528611769664Mage_Core_Model_Resource_Setup->_installResourceDb( )..\Setup.php:327
80.528611769824Mage_Core_Model_Resource_Setup->_modifyResourceDb( )..\Setup.php:421
90.529511778144include( 'C:\wamp\www\ubt.onlocal.com.au\app\code\local\Magelocal\Red\sql\red_setup\install-0.1.0.php' )..\Setup.php:624
100.529711778712Mage_Eav_Model_Entity_Setup->createEntityTables( )..\install-0.1.0.php:6
)
Error in file: "C:\wamp\www\ubt.onlocal.com.au\app\code\local\Magelocal\Red\sql\red_setup\install-0.1.0.php" - Can't create table: red_faqs_eavexample
#0 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\Resource\Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '0.1.0')
#2 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\Resource\Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('0.1.0')
#3 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\App.php(412): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 C:\wamp\www\ubt.onlocal.com.au\app\code\core\Mage\Core\Model\App.php(338): Mage_Core_Model_App->_initModules()
#6 C:\wamp\www\ubt.onlocal.com.au\app\Mage.php(640): Mage_Core_Model_App->run(Array)
#7 C:\wamp\www\ubt.onlocal.com.au\index.php(81): Mage::run('', 'store')
#8 {main}
This is a problem with an error being triggered when it shouldn't be. Long story short, MySQL doesn't support DDL transactions, and in the course of the method DDL routines are being found in the SQL and an error is thrown.
The easy answer is to comment out this line:
lib/Varien/Db/Adapter/PDO/Mysql.php
protected function _checkDdlTransaction($sql)
{
if (is_string($sql) && $this->getTransactionLevel() > 0) {
$startSql = strtolower(substr(ltrim($sql), 0, 3));
if (in_array($startSql, $this->_ddlRoutines)) {
// comment this out: trigger_error(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE, E_USER_ERROR);
}
}
}
Doing so allows your module to install. Obviously hacking a core file is a terrible idea. You should extend the method or allow the SQL to run, and then translate the generated SQL into the Magento MySQL API, as seen in core sql setup scripts. The latter is a major pain.. the better idea would be to extend the method.
More here on background information and troubleshooting.
when i laoding admin panel i got this error.
How can i solve this?
There has been an error processing your request
Mage registry key "_singleton/awall/feed_extensions" already exists
Trace:
#0 /var/www/magento_upgrade/app/Mage.php(222): Mage::throwException('Mage registry k...')
#1 /var/www/magento_upgrade/app/Mage.php(476): Mage::register('_singleton/awal...', false)
#2 /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('awall/feed_exte...')
#3 /var/www/magento_upgrade/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#4 /var/www/magento_upgrade/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
#5 /var/www/magento_upgrade/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#6 /var/www/magento_upgrade/app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
#7 /var/www/magento_upgrade/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#8 /var/www/magento_upgrade/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#10 /var/www/magento_upgrade/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#11 /var/www/magento_upgrade/index.php(87): Mage::run('', 'store')
#12 {main}
What Usman said is right but the mystery is how could this happen?
She must be using extension from AW, it has an observer in <controller_action_predispatch>
It will call class awall/feed_extensions, type Singleton
That's why it will create registry with name _singleton/awall/feed_extensions
To debug it, we can use php's debug backtrace.
Put this line in your Mage.php under public static function registry:
public static function registry($key)
{
$str = Varien_Debug::backtrace(true, false);
if(!empty($str)){
Mage::log($str);
}
if (isset(self::$_registry[$key])) {
return self::$_registry[$key];
}
return null;
}
Using this we can backtrace who call the registry (other than the observer) because in normal condition there should not any code that call the registry directly (_singleton/awall/feed_extensions) so it should have never been called more than once.
It will log the result in [MagentosRoot]/var/log/system.log
Make sure you have turn on your log settings, in admin panel:
System > Configuration > Developer > Log Settings > Enabled [Yes]
Because you can't open your admin panel right now, you need to change it directly from database
Use this query to see if you have turn on your log setting or not:
mysql> select * from core_config_data where path like 'dev/log/active';
+-----------+---------+----------+----------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+----------------+-------+
| 244 | default | 0 | dev/log/active | 1 |
+-----------+---------+----------+----------------+-------+
1 row in set (0.00 sec)
value = 1 means you have turn it on.
If you haven't had that value in your database, just insert it:
insert into core_config_data (scope, scope_id, path, value) values ('default', 0, 'dev/log/active', 1);
If the value in database is 0, change it into 1.
This because you already registered the same key name _singleton/awall/feed_extensions. As you can see in Mage.php
public static function register($key, $value, $graceful = false)
{
if (isset(self::$_registry[$key])) {
if ($graceful) {
return;
}
self::throwException('Mage registry key "'.$key.'" already exists');
}
self::$_registry[$key] = $value;
}
So try to register using other name.
For me, it worked to simply delete all files related to AheadWorks ("AW" on them) and reinstalling, carefully this time, by putting each file on the corresponding folder.
Before refreshing the admin page, find Mage_Compiler.xml and make sure there's a line like <active>false</active>.
Daunting, a bit.
Otherwise, try this:
first go to app/etc/modules/aw_all.xml
change true to false
first go to app/etc/modules/aw_blog.xml
change true to false
then log in to admin you admin will work now.
then
go to system->tools->compilation
disable it.
now
first go to app/etc/modules/aw_all.xml
change false to true
go to app/etc/modules/aw_blog.xml
change false to true
and then check if it is working or not..
I'm late to this question but I had the same problem last night and hope this answer will help someone else (this error cost me a day). I'm using a Magento 1.9 application with a Mage World extension. On my local environment, I switched branches to work on something else but I kept getting the generic Magento error page. Looking at the var/log/system.xml, I saw this:
a:5:{i:0;s:70:"Mage registry key "_singleton/onestepcheckout/observer" already exists";i:1;s:1691:"#0 C:\Sites\myintent-shop\app\Mage.php(223): Mage::throwException('Mage registry k...')
#1 C:\Sites\myintent-shop\app\Mage.php(477): Mage::register('_singleton/ones...', false)
#2 C:\Sites\myintent-shop\app\code\core\Mage\Core\Model\App.php(1316): Mage::getSingleton('onestepcheckout...')
#3 C:\Sites\myintent-shop\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#4 C:\Sites\myintent-shop\app\code\core\Mage\Core\Controller\Varien\Action.php(339): Mage::dispatchEvent('controller_acti...', Array)
#5 C:\Sites\myintent-shop\app\code\core\Mage\Cms\Helper\Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#6 C:\Sites\myintent-shop\app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#7 C:\Sites\myintent-shop\app\code\core\Mage\Cms\controllers\IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#8 C:\Sites\myintent-shop\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Cms_IndexController->indexAction()
#9 C:\Sites\myintent-shop\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#10 C:\Sites\myintent-shop\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 C:\Sites\myintent-shop\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 C:\Sites\myintent-shop\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#13 C:\Sites\myintent-shop\index.php(87): Mage::run('', 'store')
#14 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
Turns out that I had to clear my cache directory. Easiest way to do this was to go to root -> var -> cache and delete all the "mage-*" folders within the "cache" folder (note: I kept the cdn.cache file).
So I'm loading a collection of products using this code:
$magento_time= 'some time string';
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addFieldToFilter(array(
array('attribute'=> 'updated_at', 'gt'=> date('Y-m-d H:i:s', strtotime($magento_time))),
));
$collection->save();
And getting this error in return on save:
Warning: Invalid argument supplied for foreach() in /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 970
#0 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php(970): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/magent...', 970, Array)
#1 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php(925): Mage_Eav_Model_Entity_Abstract->_collectSaveData(Object(Mage_Catalog_Model_Product))
#2 /var/www/magento/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Catalog_Model_Product))
#3 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(845): Mage_Core_Model_Abstract->save()
#4 /var/www/magento/app/code/local/MyModule/controllers/IndexController.php(16): Mage_Eav_Model_Entity_Collection_Abstract->save()
#5 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(376): MyModule_IndexController->sayHelloAction()
#6 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('sayHello')
#7 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /var/www/magento/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#9 /var/www/magento/index.php(68): Mage::run()
#10 {main}
How do I save products back to the database after they've been loaded into a collection?
Changing the following worked for me:
Manually set the current store:
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Save each collection independently.
foreach ($collection as $entry) {
$entry->save();
}
EDIT:
Note the Magento API has changed significantly since I first asked this question ~2.5 years ago - this answer may no longer apply.
You do a foreach and save elements one by one.