0

I tried implement import by Msquare answer from here import custom csv to custom table- magento 2

But I getting this error:

Fatal error: Uncaught Error: Call to a member function getData() on null in (...) app/code/PetTheme/Module/Block/Adminhtml/Dataimport/Edit/Form.php:82 Stack trace: #0

this is this line:

$form->setValues($model->getData());

Any ideas what was wrong?

Thanks!

1

probably $model is empty or dont have data. There is line

$model = $this->_coreRegistry->registry('row_data');

Use xdebug. Check what is get from this registry.

This is set in file Importdata

$this->coreRegistry->register('row_data', $rowData);

Check what is saved there ($rowData).

Also $rowData should contain object [vendor_name] \ [module_name] \Model\Locator What is it? Is it created correctly? Is it correct class?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.