Skip to content

Commit 5a9ca8d

Browse files
committed
[BUGFIX] Added correct model loading of product entity by "model_token" stored in config.
1 parent 1bbefc7 commit 5a9ca8d

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/app/code/community/AvS/FastSimpleImport/Model/Import.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public function processProductImport($data, $behavior = NULL)
7575
$partialIndexing = $this->getPartialIndexing();
7676

7777
/** @var $entityAdapter AvS_FastSimpleImport_Model_Import_Entity_Product */
78-
$entityAdapter = Mage::getModel('fastsimpleimport/import_entity_product');
78+
$validTypes = Mage_ImportExport_Model_Config::getModels(Mage_ImportExport_Model_Import::CONFIG_KEY_ENTITIES);
79+
$entityAdapter = Mage::getModel($validTypes[$this->getEntity()]['model']);
7980
$entityAdapter->setBehavior($this->getBehavior());
8081
$entityAdapter->setIsDryrun(false);
8182
$entityAdapter->setErrorLimit($this->getErrorLimit());

src/app/code/community/AvS/FastSimpleImport/etc/config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929

3030
<importexport module="importexport">
3131
<import_entities>
32+
<catalog_product translate="label">
33+
<model_token>fastsimpleimport/import_entity_product</model_token>
34+
<label>Product</label>
35+
</catalog_product>
3236
<catalog_category translate="label">
3337
<model_token>fastsimpleimport/import_entity_category</model_token>
3438
<label>Category</label>

src/app/etc/modules/AvS_FastSimpleImport.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<AvS_FastSimpleImport>
55
<active>true</active>
66
<codePool>community</codePool>
7+
<depends>
8+
<Mage_ImportExport/>
9+
</depends>
710
</AvS_FastSimpleImport>
811
</modules>
912
</config>

0 commit comments

Comments
 (0)