Closed ascheider closed 1 year ago
@BlackbitDevs Do you have any idea, why it happens?
What is the object ID / fullpath? /Product Catalogue/Sheet/PMMA/Röhm/PLEXIGLAS® GS/PLEXIGLAS® GS Acrylglas Platte/PLEXIGLAS® GS Acrylglas Platte 3050 x 2030 x 12 mm, Farblos
? Hmm, actually it says object /Product Catalogue/Sheet/PMMA/Röhm/PLEXIGLAS® GS/PLEXIGLAS® GS Acrylglas Platte/PLEXIGLAS® GS Acrylglas Platte 3050 x 2030 x 12 mm, Farblos queued for saving
. Think in 3.5 I have added a log entry when the object does not get saved.
Do you have the chance to try of the problem still occurs in 3.5.x-dev
? If it does not, I will try to spot the changes and backport them into 3.4.
@BlackbitDevs Hi,
yes the path is "/Product Catalogue/Sheet/PMMA/Röhm/PLEXIGLAS® GS/PLEXIGLAS® GS Acrylglas Platte/PLEXIGLAS® GS Acrylglas Platte 3050 x 2030 x 12 mm, Farblos" this is object variant.
Same result with 3.5 dev.
Here the log:
log_3.5-dev.txt
Object id in pim is: 128226
There is no "Not saving object #128226" or "Successfully saved object #128226" in the log.
Maybe something variant related here?
@BlackbitDevs i debuged it further.
The object is queued and and set in setCachedItem but not exists in getCachedItem
Also missing in saveItems item in cache: 128226
Could it be AbstractElement[]|SplObjectStorage issue? I'm pretty desparate on this point;)
@BlackbitDevs Hi,
it seems saveItems is not called for the elements:
log_items.txt
If i change if($keyValueDatasetIndex > 0) to if($this->itemCache->count() > 0) i have somehow endless loop somewhere.
@ascheider Can you try to enable "Compatibility mode" in dataport's advanced settings (on settings tab)? Does it work then?
The problem is with the nested iteration of $this->itemCache (lib/Pim/Item/Importer.php):
`foreach ($this->itemCache as $item) { ... $this->saveObject($item); ... }
private function saveObject(AbstractModel $item) { ... // HERE ITERATOR-KEY IS MOVED AT THE END foreach ($this->itemCache as $otherItem) { if ($item !== $otherItem && $item->getFullPath() === $otherItem->getFullPath() && !$this->isModified($item, $otherItem, null, false)) { $this->log($item, 'Latest draft version and latest published version of '.\Pimcore\Model\Element\Service::getElementType($item).' #'.$item->getId().' do not differ -> will not save new draft version', 'info'); $saveVersion = false; } } ... }`
Example in sandbox: https://onlinephp.io/c/5690e
As a bug-fix you can use clone in the second loop:
Oh my goodness, @sevarozh thank you very much! I was not aware of this. Currently checking if there is a way without cloning... will fix this ASAP!
After looping the Iterator the reset()
method sets the current key back to the initial value - without cloning / copying $this->itemCache
.
@ascheider Can you please try if the problem is solved in 3.4.x-dev
? Alternatively you can also try 3.5.x-dev
, the applied fix is the same.
After looping the Iterator the
reset()
method sets the current key back to the initial value - without cloning / copying$this->itemCache
.
Yes, it looks good!
@BlackbitDevs i think we can close the issue. @sevarozh tested it already in the project. As i can see you already released the bugfix in 3.4.13. Thanks!
@BlackbitDevs Unfortunately the import still does not work for me. Single Log: single-log.txt Tried it with 3.4.14 and 3.5
@AndiKeiser Can you try to enable "Compatibility mode" in dataport's advanced settings (on settings tab)? Does it work then?
@BlackbitDevs Sorry false alarm. It was Pimcore.
I have currently problem with the import. The object variant is queued for saving, but never saved in full import context. If i import the object via preview it works fine. Data Director Version: 3.4.9 Full Log: full-log.txt Single log: single-log.txt Data Port Config: netherlands-import-european-variants.json.txt Search for the: SPMMA0120VVCL00 Saving #128226 is missing in full import