Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Importing products - using a cron job to call Magento Dataflow import
 
aiva
Jr. Member
 
Total Posts:  17
Joined:  2009-02-04
 

This is what i have done:

First of all I tried the import with only the needed fields for me..these are: “sku”;"qty". That didn’t work via script, works via backend.

So I exported all the products to a file, changed couple of quantities. Tried to import the same file via script..still the same warning “Warning: Invalid argument supplied for foreach() in /app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 937 ” and no change in the store. Imported the same file via backend, using the same import profile (id 3) and worked fine.

Tried once more with the fields you mentioned earlier:

“sku”;"price”;"special_price”;"qty”;"is_in_stock”;"status”;"store”;"websites”;"category_ids"
“83990”;"8400.0000”;"”;"100.0000”;"1”;"Enabled”;"admin”;"base”;"4"
“454adf”;"1600.0000”;"”;"0.0000”;"1”;"Enabled”;"admin”;"base”;"4”

..but unfortunately that didn’t work either. Tried different delimiters also, no luck. Using text-editor btw, no excel. Locale is default english.

@goldfish22: Thanks for reply. What version of Magento are you using? Did you make any changes to the code?

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

something I would try , I would get rid of the “” around the numbers. qty, is_in_stock, price, special_price (it may be confusing those values with text not numerics)
remove decimals off the qty’s (not sure that will have any effect)
make the special price the same as the price, to ensure there is no empty field.

now using 1.3, and not tested the auto import yet, a job for today, prior we were using the latest release.

I have noticed a few odd things in using the cron import, but generally I stick to having something that is in the same format as the export that the cron imports and have had no major problems.

here is an example of the csv we are successfully using.

"sku","qty","is_in_stock","price","special_price","status","store","websites","category_ids","aw_fp_enabled"
"B10-ALBSP"
,3,1,94.60,94.60,"Enabled","admin","base","65,69","Yes"

my settings for export and import are listed below.
try setting things the same, doing an export, modify one of the prices, then doing a back end import, make sure it works OK.
then modify another price and try a cron import.
obvious things to check, that the file is in the import folder, the profile names are correct.

Oh and one more thing, I seem to have one profile that just doesn’t work properly.  I don’t know what happened to it or why, but it seems to cause an error.  I created a new one with the same settings and it works fine.  So might be worth creating a new import profile from scratch.

Image Attachments
imp-exp.jpgimp-exp.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
aiva
Jr. Member
 
Total Posts:  17
Joined:  2009-02-04
 

Thanks a lot for the effort mate.

I’ve tried i think all the possible variants: numeric values, decimals and no decimals, different profiles (including making a new profile with exactly same options as your screenshot), saving files as UTF-8 and all that on two different servers, both running 1.3.0 but no luck so far. And all the variants worked still fine via backend. Going mad :| I’m actually thinking about installing a previous version somewhere to find out if it’s me that can’t make it. Let me know how you go with the cron import with v1.3

One good thing about this script not working for me as expected also - I get a .csv from a warehousing software and lots of products were added to their database recently, so now i got to import all the new products without having to update the ones already present in Magento, which already have been edited by the client. Would have no idea how to make the import skip those rows otherwise

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

looks like I might have a prob in 1.3 as well, am investigating further now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

yep, mines dead as well, something changed in 1.3 that stops the cron import working (at least on mine anyway) unfortunately I’m not a php guru to figure it out.  but will investigate.

investigating the log files show the error is
2009-04-03T01:37:15+00:00 DEBUG (7): Warning: Invalid argument supplied for foreach() in /home/domain/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 937

 
Magento Community Magento Community
Magento Community
Magento Community
 
aiva
Jr. Member
 
Total Posts:  17
Joined:  2009-02-04
 

I’m glad you have the same error smile

I know the error is being triggered by the call to the saveRow() function somewhere around line 60 in the code:

try {
   $adapter
->saveRow($importData);
}

so now i wonder if it is the $importData thats structure has changed since previous version or is it somewhere else in the code that is run after a call to the saveRow()

 
Magento Community Magento Community
Magento Community
Magento Community
 
lilmuckers
Jr. Member
 
Total Posts:  15
Joined:  2008-06-18
 

i’ve got the same issue with 1.3.0

Something definitely changed in this update, since it was running hourly for many months before this.

a cursory glance doesn’t appear to reveal the reason for this and i don’t understand magentos code well enough to go hunting for it.

any clues?

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

I have had a bit of a dig but no good, will keep looking.  hopefully there is a php guru that can help us out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

anyone had any luck?

 
Magento Community Magento Community
Magento Community
Magento Community
 
aiva
Jr. Member
 
Total Posts:  17
Joined:  2009-02-04
 

No luck. I did contact the author couple of days ago and he said he doesn’t know what the issue is as he hasn’t had time to look at it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blakew
Sr. Member
 
Total Posts:  107
Joined:  2008-06-20
 

I am having the same issue. I have a default installation and I can’t load up a product and save. It just errors. The same errors you guys are getting.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

Same here. I’m getting the same error after upgrading to 1.3.0. I will invistigate my error and I will post my findings. But I guess I’m having the same problem as others. This was working just fine before upgrading to 1.3.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

My error is apperantly different.
Here is what I’m getting now:

Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat::verifyIds() in
/home/user/public_html/app/code/core/Mage/Catalog/Model/Category.php on line 498

 
Magento Community Magento Community
Magento Community
Magento Community
 
blakew
Sr. Member
 
Total Posts:  107
Joined:  2008-06-20
 

This issue is on line 931 of /app/code/core/Mage/Eav/Model/Entity/Abstract.php.

$origData $this->_getOrigObject($newObject)->getOrigData();

Doing a var_dump showed that this variable, $origData, is null. I believe our issue is that this variable is null. I also believe that this rabbit hole goes deeper than many of us imagined. Some Magento staff commenting on this would be greatly appreciated.

var_dump($origData);
 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 
blakew - 09 April 2009 10:30 AM

... . Some Magento staff commenting on this would be greatly appreciated.

I would not waste my time and wait for Magento Team to respond to this. They never respond to questions and problems on the forum. We need to figure this out ourselves.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top