I'm carrying an issue where I have 2 fields images and the second image get the first images and when I the content it override the second image for the first one.
I'm trying a way to replicate the problem, but at least I could start describing my setup.
I've this modules installed and enabled.
- paragraphs
- embed
- embed_entity
- entity_browser
- file_browser
I start creating the paragraphs types. I create two types. First the Image Item, where the fields is an image with the widget form "file browser". And a second paragraph that relate the first paragraph to add many images. Then I add a paragraph field in the content, lets say Article form the standard installation profile. When I click to add two images it work perfect. But when I edit the node the second image fetch the first image and if I save that the second image get override in the process.
What could be the issue with it? Before I didn't have this problem but I'm not sure if with the last update something start to get messy with it. What could be ?
Comment | File | Size | Author |
---|---|---|---|
#21 | 2671378-21.patch | 2.21 KB | dawehner |
#14 | entity_browser-load_correct_entities-2671378-14.patch | 1.32 KB | arknoll |
#12 | entity_browser-load_correct_entities-2671378-12.patch | 1.35 KB | javivf |
#4 | Screenshot from 2016-02-22 10-25-06.png | 81.36 KB | killua99 |
Comments
Comment #2
slashrsm CreditAttribution: slashrsm at Examiner.com commentedI don't completely understand your problem. Could you attach few screenshots? Which version of entity browser are you using? Try -dev if you didn't already.
Comment #3
killua99 CreditAttribution: killua99 commentedYes all the modules are in dev, and Drupal 8.0.3
Comment #4
killua99 CreditAttribution: killua99 commentedWell the effect is like this.
Comment #5
jonathanshawI think you may be right in your comment on #2631590: After previewing an entity with nested paragraphs, EntityChangedConstraintValidator sometimes leaves a node entity un-saveable that this issue is related to that, and is therefore a Paragraphs issue not an Entity Browser issue.
However, when I try I can't reproduce the issue you're describing (which is typical of #2631590: After previewing an entity with nested paragraphs, EntityChangedConstraintValidator sometimes leaves a node entity un-saveable).
Can you provide exact and tested steps to reproduce the behaviour you see using simplytest.me?
It would be a huge help if you could. We could then confirm whether or not the issue is with Paragraphs, and move issue to that module's queue.
Comment #6
killua99 CreditAttribution: killua99 commentedYes I tried to use simpletest.me but the issue is, File Browser use a few JS library to be able to work, so the module doesn't install it self.
I deactivate the widget "File Browser" I'm using a field Image, and File Browser (module) add an extension to use entity browser on a image field. So recapping, when I deactivate the widget File Browser in the Form View, the images start looking right. So I'm guessing isn't the paragraphs it self doing something wrong. Might be a Mix with Entity Browser and File Browser.
Comment #7
slashrsm CreditAttribution: slashrsm at Examiner.com commentedAs @jonathanjfshaw already mentioned it would be great if you could provide clear reproduction steps. This would help us to make sure we are all on the same page and we all understand this issue correctly.
Comment #8
killua99 CreditAttribution: killua99 commentedI guess I found the issue I add another issue here.
#2681227: Entity Browser in adition with File Browser doesn't handle well the render cache.
My thought in my investigation are the Storage tag is always the same with fields like paragraph with the same name are called so we get the duplication render.
Comment #9
reekris CreditAttribution: reekris commentedI also have the issue of image fields getting duplicated and populated automatically from other references when adding new ones. I get this issue when there is an image field using the entity browser widget in a Paragraph entity and also when using Inline Entity Forn to reference entities containing image fields.
You should be able to reproduce the issue following the steps below:
1. Fresh install of Drupal with Entity Browse (dev), Entity Browser Example and IEF (dev) installed
2. Create a field on Article referencing "Entity browser test" items. Set unimited number of items and form display to IEF complex.
3. Create a new Article node and add a new "Entity browser test" entity by clicking "add new node". Populate the first "files" field with an image and save the node.
4. Save the Article node.
5. Edit the Article node again.
6 Click "edit" on the referenced node created in step 3.
7. Click "Cancel"
8. Click "add new node" to start creating another "Entity browser test" entity.
9. The new reference will now have the "files" field prepopulated with the image from the first entity.
This was the easiest way I could find to reproduce the issue. Hopefully it's clear enough :)
@kilua99 Have you gotten any further in your investigation of the issue?
Comment #10
killua99 CreditAttribution: killua99 commentedNo that much I'll like to continue debugging this.
I did a small debugging and I saw the CacheStorage for the Render doesn't have the proper name. Fields always have the same name so if we have the same field for example: field_image so the CacheStorageTag will be, paragrah.field.field_image so when it get call it again it render that Cache Tag, we need something like uuid field for that form to write the CacheStorageTage.
I saw a PR in github that said something about "context" no idea if that PR could solve this issue.
Also I'm going to put this as Needs Work because the bug is confirmed and with instruction to replicate it.
Links to keep on track.
https://www.drupal.org/node/2678866#new
https://github.com/drupal-media/entity_browser/pull/145
Comment #11
jonathanshawI can reproduce using the steps in #9.
I tried to reproduce without entity browser, to see if it was an IEF issue, but I could not.
Comment #12
javivf CreditAttribution: javivf commentedI solved with this patch, I used entity data insted form_state data
Comment #13
reekris CreditAttribution: reekris commentedThe patch in #12 seems to work for me. Since applying it I haven't been able to reproduce the issue. Great job @javivf!
Comment #14
arknoll CreditAttribution: arknoll commentedPatch worked for me. I updated for some code quality changes. Marking RTBC.
Comment #15
jonathanshawI wonder if this is related:
#2669326: FileWidget inside subform can't find its values
Comment #16
Ralf Eisler CreditAttribution: Ralf Eisler commentedThis patch from #14 worked for me as well.
Could it be implemented in future releases?
Comment #17
chr.fritschWorks here as well. +1
Comment #18
slashrsm CreditAttribution: slashrsm as a volunteer commentedHunk that we're changing here was added to fix another bug: #2667448: Field widget can potentially lose information about selected entities in case of unrelated AJAX requests. This patch re-introduces it.
It is strange that we do empty check on form state and load values from $items after that.
Would another elseif work?
Comment #19
killua99 CreditAttribution: killua99 commentedWe're using this patch since we found it and submit it, and we're not having that lose data on any ajax callback. How could we test it??
Comment #20
slashrsm CreditAttribution: slashrsm as a volunteer commentedSee the issue that I linked. There are steps in there.
Comment #21
dawehnerHere is an alternative patch which should not reintroduce the problem described in #2667448: Field widget can potentially lose information about selected entities in case of unrelated AJAX requests
The idea, @slashrsm and myself talked about using simply a more unique key in form state.
Comment #22
dawehner.
Comment #23
ooystein CreditAttribution: ooystein at Ramsalt Lab commentedI'm using the patch from #21 and it seems to work fine for me!
Comment #25
slashrsm CreditAttribution: slashrsm at MD Systems GmbH for Acquia commentedCommitted. Thanks!