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.
In #2776787: Create IEF widget which allows to edit the media entities after the upload we introduced a really critical bug.
If you are using dropzonejs widget in EB with multistep selection, then every uploaded image will create 2 media entities.
Here is a patch: https://www.drupal.org/files/issues/create_ief_widget_which-2776787-36.p...
Comment | File | Size | Author |
---|---|---|---|
#10 | dropzonejs_in_eb-2825429-10.patch | 2.76 KB | chr.fritsch |
#6 | interdiff-2825429-4-6.txt | 1.47 KB | chr.fritsch |
#6 | dropzonejs_in_eb-2825429-6.patch | 2.71 KB | chr.fritsch |
#4 | dropzonejs_in_eb-2825429-4.patch | 2.04 KB | chr.fritsch |
#3 | create_ief_widget_which-2776787-36.patch.txt | 668 bytes | Primsi |
Comments
Comment #2
chr.fritschComment #3
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedThanks for the patch (adding it to files so that testbot can see it). It would be great if somebody who uses this functionality could test it properly.
Comment #4
chr.fritschOne thing was missing in the first patch. We have to clean up the form_state in clearFormValues.
Also i removed class property. There was no need for that
Comment #5
alduya CreditAttribution: alduya at 2DotsTwice bvba commentedThe patch in #4 solves the problem for me.
Comment #6
chr.fritschSome additional work
If an Image is dropped into IEF Dropzone and then you are dropping another one before submitting, the second image will be used.
Comment #7
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedShouldn't we handle this exception?
Apart from that all seems to work normally as far as I could test. Thanks for the work!
Comment #8
chr.fritschI am not sure how to handle it. The method is called twice, so on the second run it will always fail, because image is already moved. I don't know what we should do there
Comment #9
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedHm, I was thinking, is this the right approach then? Can we fix this at the source of the problem (if possible) instead of fighting consequences?
Comment #10
chr.fritschOk, i try to decouple all the patches.
So in this one i let the stuff for IEF Dropzone out.
Also i removed the try catch and added a check if the file exists.
Comment #12
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedCool. Tested this with various widgets and it seems to fix the issue. Many thanks.