What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello all, I am extending the DataImport with the following writer. ```/** * @inheritDoc
Hello all,
I am extending the DataImport with the following writer.
/** * @inheritDoc */ public function write(DataSetInterface $dataSet) { $this->setDataSetWriterPersistenceState(false); $spyProductQuery = SpyProductAbstractQuery::create() ->filterBySku($dataSet[static::KEY_ATTRIBUTES]) ->findOneOrCreate(); $spyProductQuery->setAttributes($dataSet[static::KEY_ATTRIBUTES]); $spyProductQuery->setSku($dataSet[static::KEY_SKU]); $spyProductQuery->save(); $spyProductLocalizedAttributesQuery = SpyProductLocalizedAttributesQuery::create() ->filterByfkproduct($spyProductQuery->getIdProductAbstract()) ->findOneOrCreate(); $spyProductLocalizedAttributesQuery->setFkLocale(66); $spyProductLocalizedAttributesQuery->setFkProduct($spyProductQuery->getIdProductAbstract()); $spyProductLocalizedAttributesQuery->setAttributes($dataSet[static::KEY_ATTRIBUTES]); $spyProductLocalizedAttributesQuery->setDescription('placeholder description'); $spyProductLocalizedAttributesQuery->setName($dataSet[static::KEY_ATTRIBUTES]); $spyProductLocalizedAttributesQuery->save(); }
When I run the import, I get the following error. Can someone please advise me what I might be doing wrong? The code up to $spyProductQuery->save();
is running file. Something after this is giving me the following error:
Starting import with /data/data/import/local/full_EU.yml configuration file. Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: Unable to execute INSERT statement [INSERT INTO `spy_product_localized_attributes` (`id_product_attributes`, `fk_locale`, `fk_product`, `attributes`, `description`, `name`, `created_at`, `updated_at`) VALUES (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7)] DataImport for "aep-import-abstract-product" at data set position "1" has an error. For debugging execute "vendor/bin/console data:import:aep-import-abstract-product -o 1 -l 1 -t"
Comments
-
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
gibt es die Locale 66 in your spy_locale table?
0 -
@UL65CH0MC Yes there is
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
then please take a look in propel.log..
maybe smth is missing and propel try to do an insert instead an update..0 -
you can turn the propel debug on and then you will see the complete statement. copy and run it directly.
0 -
@UL65CH0MC Can you please tell me where is propel.log located?
0 -
for propel.log you have to enable the propel debug first
0 -
@UK7KBE2JW Is there reference documentation on how to enable it in Spryker?
0 -
Dunno if there is a reference in documentation. Some reference is taking a look into the config from those modules.
$config[PropelConstants::PROPEL_DEBUG] = true; $config[PropelOrmConstants::PROPEL_SHOW_EXTENDED_EXCEPTION] = true;
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random