BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

[Bug] Error when clicked 'Auto Create' button #43

Closed kaurov closed 2 years ago

kaurov commented 2 years ago

ErrorException: Warning: Undefined array key "masterDocument" in /vendor/blackbit/data-director/lib/Pim/Helper.php:226 Stack trace:

0 /vendor/blackbit/data-director/lib/Pim/Parser/NaiveParser.php(321): Blackbit\DataDirectorBundle\lib\Pim\Helper->getFieldDefinitions(Array)

1 /vendor/blackbit/data-director/lib/Pim/Parser/NaiveParser.php(379): Blackbit\DataDirectorBundle\lib\Pim\Parser\NaiveParser->getDataQuerySelectors(Array, 'pimCategory:cat...', 'Produkt Familie...')

2 /vendor/blackbit/data-director/lib/Pim/Parser/NaiveParser.php(410): Blackbit\DataDirectorBundle\lib\Pim\Parser\NaiveParser->getDataQuerySelectors(Array, 'pimCategory', 'Produkt Familie')

3/vendor/blackbit/data-director/lib/Pim/Parser/NaiveParser.php(332): Blackbit\DataDirectorBundle\lib\Pim\Parser\NaiveParser->getDataQuerySelectors(Array, 'pimCategory', 'Produkt Familie')

4 /vendor/blackbit/data-director/lib/Pim/Parser/NaiveParser.php(260): Blackbit\DataDirectorBundle\lib\Pim\Parser\NaiveParser->getDataQuerySelectors(Array)

5 /vendor/blackbit/data-director/Controller/ImportconfigController.php(2508): Blackbit\DataDirectorBundle\lib\Pim\Parser\NaiveParser->guessConfig()

6 /vendor/symfony/http-kernel/HttpKernel.php(152): Blackbit\DataDirectorBundle\Controller\ImportconfigController->autoCreateRawdataFieldsAction(Object(Symfony\Component\HttpFoundation\Request))

7 /vendor/symfony/http-kernel/HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

8 /vendor/symfony/http-kernel/Kernel.php(202): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

9 /public/index.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))

10 {main}

BlackbitDevs commented 2 years ago

Fixed in 3.1 You have an import with target class Document but have not set a Master Document, right? The master document is necessary to know which fields can be mapped in attribute mapping. But of course the error should not appear. Here is an excerpt from the manual about importing documents:

Import documents

Document imports allow creating documents based on a set master document. All editables of the master document are available in the import's attribute mapping. You can either build a view with editables or create the document structure dynamically via area blocks.

The set master document will be set as content master document in newly created documents. This allows for prefilling content in the master document which does not need to be imported.

kaurov commented 2 years ago

I clicked it on 'Export' dataport. I believe, it should live with existing objects as is, without errors. And of course, the user interface should work. At least, for those fields that can be generated. All 'wrong' fields can be skipped but without errors.

BlackbitDevs commented 2 years ago

Ah I see, it is for an export of documents. Without content master document the actual data fields could not be auto-generated - and in 3.1 for Document exports there was no such field. In 3.1 I fixed the Undefined array key problem but in 3.2 I now changed document exports so that you can specify a master document also for exports. Until 3.1 you could only export system fields of documents like object name or path and via callback functions get generated HTML etc. But from 3.2 you can now export the single fields of Documents.