Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For some reason on a lot of my products the images are empty when editing using inline entity form, while on others they are not empty. This happens even though there is an existing image.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2224915-images-empty-when-editing-products-using-ief-8.patch | 2.31 KB | energee |
| |||
#2 | 2224915-images-empty-when-editing-products-using-ief-2.patch | 1.78 KB | mglaman |
Screenshot 2014-03-24 18.51.03.png | 75.25 KB | lsolesen |
Comments
Comment #1
mglamanConfirmed, it is an issue with...
on a multilingual site. If there is a check for $langcode being empty and setting it as LANGUAGE_NONE; it fixes the issue. For some reason the Image field doesn't populate properly on the entity edit form unless $langcode is explicitly set.
Moving this to inline_entity_form, patch to follow.
Comment #2
mglamanApply a fallback to set language code to undefined if entity_language empty
Comment #3
mglamanComment #4
lsolesen CreditAttribution: lsolesen commentedI can confirm that this works.
Comment #5
msamavi CreditAttribution: msamavi commentedThe same issue here, but the patch did not work for me!
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedThis looks like a revert of #1558632: Pass correct langcode to field_attach_form, newly created entities. which means we need more research on which one's correct.
Comment #7
energee CreditAttribution: energee as a volunteer commentedThe above patch does not include a fix on the default entity form.
Comment #8
energee CreditAttribution: energee as a volunteer commentedPatch attached.
Comment #11
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedComment #13
mattew CreditAttribution: mattew commentedGot the same issue with a custom entity (not a commerce product) and this patch solved the issue for me. The images are now visible in my field using IEF, FYI here is a summary of my setup:
Would you like me to test something more on my implementation?
Thanks for the patch
Comment #14
matthiasm11 CreditAttribution: matthiasm11 at MM-Experience commentedPatch #9 from the referenced issue solves this problem at a higher level, with entity translation support instead of hardcoded LANGUAGE_NONE.