Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error in prepareAttributesForSave #416

Open
daaru00 opened this issue Jan 25, 2018 · 6 comments
Open

PHP Fatal error in prepareAttributesForSave #416

daaru00 opened this issue Jan 25, 2018 · 6 comments

Comments

@daaru00
Copy link

daaru00 commented Jan 25, 2018

Using AvS_FastSimpleImport_Model_Import->processProductImport([..]) I receiving this error:

PHP Fatal error: Uncaught Error: Call to a member function prepareAttributesForSave() on null in /var/www/html/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php:1417
Stack trace:
#0 /var/www/html/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php(481): AvS_FastSimpleImport_Model_Import_Entity_Product->_saveProducts()
#1 /var/www/html/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php(522): Mage_ImportExport_Model_Import_Entity_Product->_importData()
#2 /var/www/html/app/code/core/Mage/ImportExport/Model/Import.php(325): Mage_ImportExport_Model_Import_Entity_Abstract->importData()
#3 /var/www/html/app/code/community/AvS/FastSimpleImport/Model/Import.php(123): Mage_ImportExport_Model_Import->importSource()

I think the input data in not correctly validated, it would be better to handle this kind of error instead of let it throwing a Fatal error.

@testBanana
Copy link

i am receiving the same error...did you find any solution to this issue?

@daaru00
Copy link
Author

daaru00 commented Sep 7, 2018

Hi @testBanana

sorry but it's been too long, I do not remember well.. I think it was connected to a wrong data set, try to check if you are importing using an existing product type or something like that.

@testBanana
Copy link

ok....thanks ... i will check this..

@pixlogix
Copy link

pixlogix commented Sep 12, 2018

Hi there,

When we delete any product and try to import data that time we gets below error and unable to import data.

Fatal error: Call to a member function prepareAttributesForSave() on null in /app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php on line 1434

If we use fresh Magento setup that time it is working fine but if we delete at-least 1 or more products and try to import that time it is not working and found above error.

I hope someone have solution of this issue.

@testBanana
Copy link

i found the issue and it was just a encoding problem...
this means that in the product attributes were some malformed UTF-8 characters...

and so the import didn't work.

i've fixed it with iconv, like this...

.....
foreach ($matches[1] as $key => $featureId) { $featuresAndValues["term_merkmal_$featureId"] = iconv('UTF-8', 'UTF-8//IGNORE', substr($matches[2][$key], 0, 255)); }
....

now the import is working just fine...

@pixlogix: check if you have malformed characters..., or try to import just some products...

@pixlogix
Copy link

pixlogix commented Sep 12, 2018

Hi @testBanana

Thank you for your quick reply.

Sometime it is working fine and sometime it's not working. We are already using iconv() function. Also we have tried to change $productType with static (http://prntscr.com/ktfgwu) and it is working fine but looks like frontend testing array value empty (http://prntscr.com/ktfim7) even products imports fine.

We think, it might be many factors to fix issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants