Comments (10)
Yes sounds good. Feel free to provide a PR if you need this fix soon. Anyway we’ll do our best to fix this issue ASAP.
from syliusakeneoplugin.
Yes. It's because now the plugin properly imports attributes that have been emptied on Akeneo. So if you have at least one empty attribute imported with the TranslatablePropertyValueHandler
, now the plugin creates the translations for all languages to be able to set null
on that property. So now it fails if you have untranslated products on Akeneo (at least for the not nullable properties).
A quick solution to this is to implement a listener on the product.pre_create/update event which removes empty translations before saving.
Another solution it could be to not create the translation in the TranslatablePropertyValueHandler
if the value is null.
What do you think? We're open to suggestions.
from syliusakeneoplugin.
In my opinion I would not create a translation if it cannot be created with valid data.
In a setup where the default locale is X and there's also "optional" locales A, B, C, a missing translation leads to a failed import (even though the data is "valid" in Akeneo).
So, I'd not create the translation at all.
from syliusakeneoplugin.
Hi @aleho,
have a look at the #63 PR for this issue.
Let me know what do you think.
from syliusakeneoplugin.
Sorry, there was a lot going on and I couldn't get the import to run.
Apparently if productVariants
on $existentProductImage
is null (ImageValueHandler:104) the check hasProductVariant
fails completely. It should be set in the constructor, but apparently that's never called for existing entities.
What's especially odd here: $existentProductImage instanceof Sylius\Component\Core\ModelProductImage
, even though Sylius is set up and configured correctly and the entity has not been touched:
$ console debug:container --parameter=sylius.model.product_image.class
---------------------------------- ---------------------------------
Parameter Value
---------------------------------- ---------------------------------
sylius.model.product_image.class App\Entity\Product\ProductImage
---------------------------------- ---------------------------------
So I couldn't even override the method in there to check of the collection to do a temporary check like return($this->productVariants && parent::hasProductVariant($productVariant));
.
What's wrong there?
Edit: I tried with a completely empty product table. Initial import works, subsequent ones are broken.
from syliusakeneoplugin.
@aleho we never had this issue. Btw I don't think it's related to empty translations.
from syliusakeneoplugin.
It only happens since bbaecd1. Haven't had time to investigate, but a clean import and subsequent update fails and can be reproduced here.
I'll try to get more details as soon as possible.
from syliusakeneoplugin.
Ok thank you. Please, when you'll have further details open a new issue for the ImageValueHandler bug.
This one is for empty translations (so the TranlsatablePropertyValueHandler).
from syliusakeneoplugin.
You're right. I suspected the commit being the culprit for the other problem too (but should have opened a separate issue anyway).
Turns out, FriendsOfSylius/SyliusImportExportPlugin overrides the configuration in a very unexpected way.
Sorry for the noise, just thought to comment this here for the sake of completeness.
from syliusakeneoplugin.
Thank you for the update @aleho !
from syliusakeneoplugin.
Related Issues (20)
- Use PHP 8 syntax
- Extract downloadFile in a new service
- [BUG?] - Some attribute option labels are not initialized to null
- [BUG] - Do not add product translation entity for locale not used in any channels of the product HOT 1
- Dispatch custom Akeneo plugin events HOT 1
- Update docs
- Improve importing product feature test
- Clear files and code no more used
- Move ApiClientMock file and fixtures outside of Integration test dir, it is also used by Behat.
- [BUG] - Database error while creating products without name HOT 1
- [BUG] - Channel Pricing Value Handler does not check for channel scope
- Enable the admin to manually force import of all products, attribute options and product associations HOT 1
- Admin user mass product update button HOT 1
- Disable Product accordingly to product Variants Status
- A non-UTF8 char has to trigger an alert during the import HOT 1
- Use Akeneo Events API
- Fix roave BC check
- Use new Symfony bundle directory structure HOT 1
- [BUG] - Import Akeneo boolean attributes in Sylius select attributes
- [BUG?] - Variant images not removed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syliusakeneoplugin.